EncodingResultBackend class
Result backend decorator that applies TaskPayloadEncoder semantics.
- Implemented types
Constructors
- EncodingResultBackend(ResultBackend _inner, TaskPayloadEncoderRegistry registry)
- Creates an encoding wrapper around the provided backend.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- inner → ResultBackend
-
The wrapped backend used for persistence.
no setter
- registry → TaskPayloadEncoderRegistry
-
Encoder registry used to decode/encode stored payloads.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- supportsAtomicTerminalWrites → bool
-
Whether this backend provides a cross-process atomic terminal write.
no setteroverride
Methods
-
addGroupResult(
String groupId, TaskStatus status) → Future< GroupStatus?> -
Adds a group result after encoding the payload for storage.
override
-
claimChord(
String groupId, {String? callbackTaskId, DateTime? dispatchedAt}) → Future< bool> -
Attempts to claim responsibility for dispatching the chord callback for
groupId. Returnstrueonly for the first caller; subsequent callers receivefalseonce the chord has been claimed. WhencallbackTaskIdordispatchedAtare provided, implementations SHOULD persist them with the group metadata so other components can observe dispatch progress.override -
close(
) → Future< void> -
Releases any resources held by the backend.
override
-
expire(
String taskId, Duration ttl) → Future< void> -
Updates the expiration for the given
taskId.override -
get(
String taskId) → Future< TaskStatus?> -
Fetches a task status and decodes its payload if needed.
override
-
getGroup(
String groupId) → Future< GroupStatus?> -
Loads a group status and decodes any stored payloads.
override
-
getWorkerHeartbeat(
String workerId) → Future< WorkerHeartbeat?> -
Retrieves the last persisted heartbeat snapshot for
workerId, or null if no heartbeat has been recorded within the retention window.override -
initGroup(
GroupDescriptor descriptor) → Future< void> -
Initializes a group with the given
descriptor.override -
listTaskStatuses(
TaskStatusListRequest request) → Future< TaskStatusPage> -
Lists task status records using the provided
requestfilters.override -
listWorkerHeartbeats(
) → Future< List< WorkerHeartbeat> > -
Lists all worker heartbeat snapshots.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
set(
String taskId, TaskState state, {Object? payload, TaskError? error, int attempt = 0, Map< String, Object?> meta = const {}, Duration? ttl}) → Future<void> -
Sets the status for the task with the given
taskId.override -
setTerminalIfAbsent(
TaskStatus status, {Duration? ttl}) → Future< bool> -
Attempts to persist
statusas the task's terminal state.override -
setWorkerHeartbeat(
WorkerHeartbeat heartbeat) → Future< void> -
Persist the latest
heartbeatsnapshot for a worker.override -
toString(
) → String -
A string representation of this object.
inherited
-
watch(
String taskId) → Stream< TaskStatus> -
Streams task status updates with decoded payloads.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited