mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-13 23:47:44 +00:00
20 lines
421 B
Go
20 lines
421 B
Go
package worker
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"github.com/DataDog/datadog-go/statsd"
|
|
"github.com/adjust/rmq/v4"
|
|
"github.com/go-redis/redis/v8"
|
|
"github.com/jackc/pgx/v4/pgxpool"
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
const pollDuration = 50 * time.Millisecond
|
|
|
|
type NewWorkerFn func(context.Context, *zap.Logger, *statsd.Client, *pgxpool.Pool, *redis.Client, rmq.Connection, int) Worker
|
|
type Worker interface {
|
|
Start() error
|
|
Stop()
|
|
}
|