2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-10-23 10:16:12 +08:00
This commit is contained in:
asdfhuang
2025-04-01 14:50:15 -03:00
committed by GitHub
8 changed files with 99 additions and 32 deletions

View File

@@ -17,7 +17,6 @@ import (
"github.com/hibiken/asynq/internal/errors"
pb "github.com/hibiken/asynq/internal/proto"
"github.com/hibiken/asynq/internal/timeutil"
"github.com/redis/go-redis/v9"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/timestamppb"
)
@@ -718,8 +717,14 @@ type Broker interface {
ClearServerState(host string, pid int, serverID string) error
// Cancelation related methods
CancelationPubSub() (*redis.PubSub, error) // TODO: Need to decouple from redis to support other brokers
SubscribeCancellation() (CancellationSubscription, error)
PublishCancelation(id string) error
WriteResult(qname, id string, data []byte) (n int, err error)
}
// CancellationSubscription is a subscription to cancellation messages.
type CancellationSubscription interface {
Channel() <-chan string // returns a channel to receive the id of tasks to be cancelled.
Close() error // closes the subscription.
}