TypedTaskHandler<TArgs, TResult> class

Typed task handler for the recommended manual registration path.

The runtime still lowers task arguments to the durable map transport, but application code receives TArgs and returns TResult. Generated task adapters can use the same contract while keeping transport decoding out of user code.

Implemented types
Available extensions

Constructors

TypedTaskHandler({required TaskDefinition<TArgs, TResult> definition, required Future<TResult> entrypoint(TaskExecutionContext context, TArgs args), TaskArgsDecoder<TArgs>? argsDecoder, TaskEntrypoint? isolateEntrypoint, TaskExecutionMode? executionMode})
Creates a typed task handler backed by definition.
const

Properties

argsDecoder TaskArgsDecoder<TArgs>?
Optional decoder for definitions that only provide an encoder.
final
definition TaskDefinition<TArgs, TResult>
Typed task definition used for naming, options, metadata, and results.
final
entrypoint Future<TResult> Function(TaskExecutionContext context, TArgs args)
Typed application handler.
final
executionMode TaskExecutionMode
Explicit execution mode, or the mode inferred from isolateEntrypoint when omitted.
no setteroverride
executionMode TaskExecutionMode

Available on TaskHandler<R>, provided by the TaskHandlerExecutionModeX extension

Returns the explicit mode when the handler provides one, otherwise preserves the historical entrypoint-based behavior.
no setter
hashCode int
The hash code for this object.
no setterinherited
isolateEntrypoint TaskEntrypoint?
Optional top-level adapter used when the task is dispatched to an execution isolate. Generated handlers provide this adapter so the durable map transport is decoded inside the child isolate.
final
metadata TaskMetadata
Describes the task for tooling and documentation.
no setteroverride
name String
The name of this task handler.
no setteroverride
options TaskOptions
The options for this task handler.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call(TaskContext context, Map<String, Object?> args) Future<TResult>
Executes the task with the given context and args.
override
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