DVSqsQueueAdapter class

DV.Queues on SQS.

SQS is not the same shape as the other adapters, and this one is written around the difference rather than over it.

It has no priority, no listing of what is waiting, and no dead-letter list this adapter owns — a redrive policy on the queue owns that, configured on the service. The operations that cannot be honoured throw rather than returning an empty list, because an empty list reads as "there is nothing" when the truth is "I cannot see".

What it does have that the others do not: a received message is invisible for a visibility timeout and returns on its own if nothing deletes it. That is the durability guarantee, and it means failing a job is a matter of handing it back early rather than recording anything.

Implemented types

Constructors

DVSqsQueueAdapter(DVSqsTransport transport, {required String queueUrl(String queue), int waitTimeSeconds = 20, Duration visibilityTimeout = const Duration(seconds: 30)})

Properties

hashCode → int
The hash code for this object.
no setterinherited
queueUrl → String Function(String queue)
The queue's URL for a Dartvel queue name.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
transport → DVSqsTransport
final
visibilityTimeout → Duration
final
waitTimeSeconds → int
Long-polling window. Zero returns immediately and bills more for the same work.
final

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 payload on queue.
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
receiptFor(String jobId) → String?
The receipt that will delete jobId, for tests and for diagnostics.
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