Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Panzer panzerdev

View GitHub Profile
@panzerdev
panzerdev / main.go
Last active Mar 16, 2019
Topic based Worker with Redis example
View main.go
package main
import (
"fmt"
"github.com/go-redis/redis"
"log"
"math/rand"
"os"
"os/signal"
"syscall"
@panzerdev
panzerdev / mysql_worker.go
Last active Jan 15, 2019
A worker based on sql with distributed locking using the DB
View mysql_worker.go
package main
import (
"context"
"database/sql"
"errors"
"github.com/jmoiron/sqlx"
"log"
"math/rand"
"time"
@panzerdev
panzerdev / redis_pub_sub.go
Last active Oct 24, 2018
Redis based worker
View redis_pub_sub.go
package main
import (
"context"
"github.com/go-redis/redis"
"sync"
"time"
)
type RedisConsumer struct {
You can’t perform that action at this time.