TaskProcessor class

Processes a single envelope without owning broker delivery lifecycle.

The processor performs portable validation, decoding, execution middleware, handler invocation, timeout handling, and retry classification. It never consumes, acknowledges, republishes, dead-letters, or manages a lease.

Constructors

TaskProcessor({required TaskRegistry registry, RetryStrategy? retryStrategy, List<Middleware> middleware = const [], PayloadSigner? signer, TaskPayloadEncoderRegistry? encoderRegistry, TaskPayloadEncoder argsEncoder = const JsonTaskPayloadEncoder(), Iterable<TaskPayloadEncoder> additionalEncoders = const [], int? randomSeed})
Creates a runtime-neutral task processor.

Properties

hashCode int
The hash code for this object.
no setterinherited
middleware List<Middleware>
Execution and error middleware.
final
payloadEncoders TaskPayloadEncoderRegistry
Payload encoder registry used to decode durable task arguments.
final
registry TaskRegistry
Registry used to resolve task handlers.
final
retryStrategy RetryStrategy
Default retry strategy.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
signer PayloadSigner?
Optional envelope signer used for verification.
final

Methods

classifyFailure(Envelope envelope, TaskHandler<Object?> handler, Object error, StackTrace stackTrace) TaskProcessOutcome
Classifies a handler failure using the shared retry policy.
classifyRetry(Envelope envelope, TaskHandler<Object?> handler, TaskRetryRequest request, StackTrace stackTrace) TaskProcessOutcome
Classifies an explicit retry without publishing or persisting it.
invoke(TaskContext context, Future<Object?> handler()) Future<Object?>
Runs execution middleware around a runtime-provided invocation.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
process(Envelope envelope, {int? deliveryAttempt, TaskStatus? existingStatus, TaskExecutionControl control = const TaskExecutionControl()}) Future<TaskProcessOutcome>
Processes envelope and returns a transport-independent outcome.
toString() String
A string representation of this object.
inherited

Operators

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