apollo-backend/internal/worker/worker.go
André Medeiros 9341e08123 feat(ops): add distributed tracing (#109)
* tracing

* instrument redis

* add instrumentation around queue acks

* adjust backoff schedules for reddit

* set proper http client on reddit

* populate account last message ID on upsert

* pass last message id on upsert

* schedule accounts in a predictable order
2022-11-05 15:59:33 -04:00

21 lines
470 B
Go

package worker
import (
"context"
"time"
"github.com/DataDog/datadog-go/statsd"
"github.com/adjust/rmq/v5"
"github.com/go-redis/redis/v8"
"github.com/jackc/pgx/v4/pgxpool"
"go.opentelemetry.io/otel/trace"
"go.uber.org/zap"
)
const pollDuration = 100 * time.Millisecond
type NewWorkerFn func(context.Context, *zap.Logger, trace.Tracer, *statsd.Client, *pgxpool.Pool, *redis.Client, rmq.Connection, int) Worker
type Worker interface {
Start() error
Stop()
}