2
0
mirror of https://github.com/hibiken/asynq.git synced 2026-07-13 16:44:21 +08:00

Add BatchEnqueue for pipelined multi-task enqueue

Adds BatchEnqueue to the Broker interface and RDB implementation that
sends multiple enqueueCmd Lua script invocations in a single Redis
pipeline round-trip. Also adds BatchEnqueueContext to the Client as
the public API, returning per-task results for partial-success handling.

Ref: hibiken/asynq#1069
This commit is contained in:
Erik Nilsen
2026-02-23 16:25:49 -08:00
parent d704b68a42
commit f919a605d5
4 changed files with 161 additions and 0 deletions

View File

@@ -692,6 +692,7 @@ type Broker interface {
Close() error
Enqueue(ctx context.Context, msg *TaskMessage) error
EnqueueUnique(ctx context.Context, msg *TaskMessage, ttl time.Duration) error
BatchEnqueue(ctx context.Context, msgs []*TaskMessage) (int, error)
Dequeue(qnames ...string) (*TaskMessage, time.Time, error)
Done(ctx context.Context, msg *TaskMessage) error
MarkAsComplete(ctx context.Context, msg *TaskMessage) error