MemoryQueueDriver class
An in-memory QueueDriver for development and testing.
Jobs are stored in Dart collections and are lost when the process exits. For production, use a persistent driver like Redis or PostgreSQL.
- Implemented types
Constructors
- MemoryQueueDriver()
- Creates a new MemoryQueueDriver.
Properties
-
completedJobs
→ List<
Job> -
Returns completed jobs (for testing/inspection).
no setter
-
failedJobs
→ List<
Job> -
Returns permanently failed jobs (for testing/inspection).
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
[String queue = 'default']) → Future< void> -
Clears all jobs from the
queue. Primarily for testing.override -
clearDeadLetters(
) → Future< void> -
Clears the dead letter queue.
override
-
complete(
Job job) → Future< void> -
Marks a
jobas completed and removes it from the active set.override -
deadLetterJobs(
) → Future< List< Map< >String, dynamic> > -
Returns all permanently failed jobs (dead letter queue).
override
-
fail(
Job job) → Future< void> -
Permanently removes a failed
joband stores it in the dead letter queue.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pop(
[String queue = 'default']) → Future< Job?> -
Pops the next available job from the
queueatomically.override -
push(
Job job, [String queue = 'default']) → Future< void> -
Pushes a
jobonto the specifiedqueue.override -
release(
Job job) → Future< void> -
Returns a
jobto the queue for retry, respecting itsavailableAt.override -
retryDeadLetter(
String jobId) → Future< bool> -
Retries a dead-letter job by its
jobId, moving it back to the queue.override -
size(
[String queue = 'default']) → Future< int> -
Returns the number of pending jobs in the
queue.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited