apollo-backend/internal/worker/worker.go

21 lines
422 B
Go
Raw Permalink Normal View History

package worker
import (
"context"
2022-05-21 17:17:04 +00:00
"time"
"github.com/DataDog/datadog-go/statsd"
"github.com/adjust/rmq/v4"
"github.com/go-redis/redis/v8"
"github.com/jackc/pgx/v4/pgxpool"
2022-05-23 18:17:25 +00:00
"go.uber.org/zap"
)
2022-05-21 17:17:04 +00:00
const pollDuration = 100 * time.Millisecond
2022-05-23 18:17:25 +00:00
type NewWorkerFn func(context.Context, *zap.Logger, *statsd.Client, *pgxpool.Pool, *redis.Client, rmq.Connection, int) Worker
type Worker interface {
2021-07-14 00:09:44 +00:00
Start() error
Stop()
}