Skip to content

Instantly share code, notes, and snippets.

View panzerdev's full-sized avatar

Michael Panzer panzerdev

  • Vizzlo
  • Leipzig
View GitHub Profile
@panzerdev
panzerdev / main.go
Last active March 16, 2019 18:06
Topic based Worker with Redis example
package main
import (
"fmt"
"github.com/go-redis/redis"
"log"
"math/rand"
"os"
"os/signal"
"syscall"
@panzerdev
panzerdev / mysql_worker.go
Last active January 15, 2019 12:43
A worker based on sql with distributed locking using the DB
package main
import (
"context"
"database/sql"
"errors"
"github.com/jmoiron/sqlx"
"log"
"math/rand"
"time"
@panzerdev
panzerdev / redis_pub_sub.go
Last active October 24, 2018 13:42
Redis based worker
package main
import (
"context"
"github.com/go-redis/redis"
"sync"
"time"
)
type RedisConsumer struct {