Envelope class

Task payload persisted inside a broker. Since: 0.1.0

Constructors

Envelope({required String name, required Map<String, Object?> args, String? id, Map<String, String>? headers, DateTime? enqueuedAt, DateTime? notBefore, int priority = 0, int attempt = 0, int maxRetries = 0, Duration? visibilityTimeout, String queue = 'default', Map<String, Object?>? meta})
Creates an envelope for a task invocation.
Envelope.fromJson(Map<String, Object?> json)
Builds an envelope from persisted JSON.
factory

Properties

args Map<String, Object?>
Arguments passed to the task handler.
final
attempt int
Current delivery attempt.
final
enqueuedAt DateTime
Time the envelope was enqueued.
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
Arbitrary metadata headers (trace id, tenant, etc).
final
id String
Unique identifier for the logical task.
final
maxRetries int
Maximum allowed retries.
final
meta Map<String, Object?>
Additional metadata persisted with the message.
final
name String
Fully qualified task name.
final
notBefore DateTime?
Optional earliest execution timestamp.
final
priority int
Priority hint (adapter specific).
final
queue String
Logical queue routing key.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
visibilityTimeout Duration?
Lease duration hint for brokers supporting visibility timeouts.
final

Methods

copyWith({String? id, Map<String, Object?>? args, Map<String, String>? headers, DateTime? enqueuedAt, DateTime? notBefore, int? priority, int? attempt, int? maxRetries, Duration? visibilityTimeout, String? queue, Map<String, Object?>? meta}) Envelope
Returns a copy of this envelope with updated fields.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, Object?>
Serializes this envelope to JSON.
toString() String
Returns the JSON representation of the envelope.
override

Operators

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