TaskQueue enum

Named task queues with weighted priority.

Different queues are processed at different rates:

  • critical: highest priority (100x weight)
  • high: higher priority (10x weight)
  • default: normal priority (1x weight)
  • low: lower priority (0.1x weight)

Useful for ensuring payment tasks complete before analytics tasks.

Example:

// Payment completes before analytics
await TaskFlow.enqueue('processPayment', queue: 'critical');
await TaskFlow.enqueue('trackAnalytics', queue: 'low');
Inheritance
Available extensions

Values

critical → const TaskQueue

Highest priority (100x execution weight) Use for: payments, critical operations, user-facing requests

const TaskQueue(weight: 100)
high → const TaskQueue

High priority (10x execution weight) Use for: uploads, downloads, user data sync

const TaskQueue(weight: 10)
default_ → const TaskQueue

Normal priority (1x execution weight - default) Use for: routine syncs, background updates

const TaskQueue(weight: 1)
low → const TaskQueue

Low priority (0.1x execution weight) Use for: analytics, logging, reporting, batch operations

const TaskQueue(weight: 0.1)

Properties

hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
name → String
Get queue name
no setter
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
weight → double
Relative execution weight (higher = executes more often)
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

fromString(String value) → TaskQueue
Parse from string

Constants

values → const List<TaskQueue>
A constant List of the values in this enum, in order of their declaration.