19 lines
597 B
Go
19 lines
597 B
Go
package worker
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/redis/go-redis/v9"
|
|
)
|
|
|
|
// StreamPublisher abstracts the subset of the Redis Streams API used by the
|
|
// route publishers to emit one outbound stream entry. The default
|
|
// implementation in production wiring is `*redis.Client`. Tests substitute
|
|
// an in-memory fake.
|
|
type StreamPublisher interface {
|
|
// XAdd appends one entry to the configured stream. Implementations must
|
|
// honour `args.MaxLen` plus `args.Approx == true` for approximate trimming
|
|
// when the caller sets them.
|
|
XAdd(ctx context.Context, args *redis.XAddArgs) *redis.StringCmd
|
|
}
|