DVRedisQueueAdapter class
DV.Queues on Redis.
Jobs live in three structures per queue: a sorted set of queued work ordered by priority then age, a hash of reserved jobs, and a list of dead letters. A worker reserves atomically, so two workers cannot take the same job — the property an in-memory queue gets for free and a distributed one has to earn.
- Implemented types
Constructors
- DVRedisQueueAdapter(DVRedisClient client, {String keyPrefix = 'dartvel:queue:'})
Properties
- client → DVRedisClient
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- keyPrefix → String
-
Prefix isolating this application's queues on a shared server.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
complete(
String id) → Future< void> -
override
-
deadLetters(
String queue) → Future< List< DVJobEnvelope< >DVJobPayload> > -
override
-
discard(
String id) → Future< bool> -
Drops one dead-lettered job. Flushing a queue to be rid of a single
poison message would take every other job with it.
override
-
enqueue<
TPayload> (String queue, TPayload payload, {int priority = 0, int maxAttempts = 3, Duration backoff = const Duration(seconds: 30), String? tenant}) → Future< DVJobEnvelope< TPayload> > -
Stores
payloadonqueue.override -
fail(
String id, String error, StackTrace stackTrace) → Future< void> -
override
-
flush(
String queue) → Future< int> -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pending(
String queue) → Future< List< DVJobEnvelope< >DVJobPayload> > -
override
-
reserve(
String queue) → Future< DVJobEnvelope< DVJobPayload> ?> -
override
-
retry(
String id) → Future< bool> -
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited