WorkflowEventRef<T> class

Typed reference to a workflow resume event topic.

This bundles the durable topic name with an optional payload codec so callers do not need to repeat a raw topic string and separate codec across wait and emit sites.

Available extensions

Constructors

WorkflowEventRef({required String topic, PayloadCodec<T>? codec})
Creates a typed workflow event reference.
const
WorkflowEventRef.codec({required String topic, required PayloadCodec<T> codec})
Creates a typed workflow event reference for DTO payloads that already expose toJson() and Type.fromJson(...).
factory
WorkflowEventRef.json({required String topic, required T decode(Map<String, dynamic> payload), String? typeName})
Creates a typed workflow event reference for DTO payloads that already expose toJson() and Type.fromJson(...).
factory
WorkflowEventRef.versionedJson({required String topic, required int version, required T decode(Map<String, dynamic> payload, int version), int? defaultDecodeVersion, String? typeName})
Creates a typed workflow event reference for DTO payloads that already expose toJson() and persist a schema version beside the payload.
factory
WorkflowEventRef.versionedJsonRegistry({required String topic, required int version, required PayloadVersionRegistry<T> registry, int? defaultDecodeVersion, String? typeName})
Creates a typed workflow event reference backed by a reusable version registry.
factory
WorkflowEventRef.versionedMap({required String topic, required Object? encode(T value), required int version, required T decode(Map<String, dynamic> payload, int version), int? defaultDecodeVersion, String? typeName})
Creates a typed workflow event reference for custom map payloads that persist a schema version beside the payload.
factory
WorkflowEventRef.versionedMapRegistry({required String topic, required Object? encode(T value), required int version, required PayloadVersionRegistry<T> registry, int? defaultDecodeVersion, String? typeName})
Creates a typed workflow event reference for custom map payloads backed by a reusable version registry.
factory

Properties

codec PayloadCodec<T>?
Optional codec for encoding and decoding event payloads.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
topic String
Durable topic name used to suspend and resume workflow runs.
final

Methods

awaitOn(FlowContext step, {DateTime? deadline, Map<String, Object?>? data}) FlowStepControl

Available on WorkflowEventRef<T>, provided by the WorkflowEventRefWaitExtension extension

Registers a low-level flow-control wait while keeping the typed event ref on the call site.
emit(WorkflowEventEmitter emitter, T value) Future<void>

Available on WorkflowEventRef<T>, provided by the WorkflowEventRefExtension extension

Emits this typed event with the provided emitter.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
wait(WorkflowResumeContext waiter, {DateTime? deadline, Map<String, Object?>? data}) Future<T>

Available on WorkflowEventRef<T>, provided by the WorkflowEventRefWaitExtension extension

Suspends until this event is emitted, then returns the decoded payload.
waitValue(WorkflowResumeContext waiter, {DateTime? deadline, Map<String, Object?>? data}) → T?

Available on WorkflowEventRef<T>, provided by the WorkflowEventRefWaitExtension extension

Registers an event wait and returns the resumed payload on the legacy null-then-resume path.

Operators

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