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()andType.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()andType.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 schemaversionbeside 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
versionbeside 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<
Registers a low-level flow-control wait while keeping the typed event ref on the call site.T> , provided by the WorkflowEventRefWaitExtension extension -
emit(
WorkflowEventEmitter emitter, T value) → Future< void> -
Available on WorkflowEventRef<
Emits this typed event with the providedT> , provided by the WorkflowEventRefExtension extensionemitter. -
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<
Suspends until this event is emitted, then returns the decoded payload.T> , provided by the WorkflowEventRefWaitExtension extension -
waitValue(
WorkflowResumeContext waiter, {DateTime? deadline, Map< String, Object?> ? data}) → T? -
Available on WorkflowEventRef<
Registers an event wait and returns the resumed payload on the legacy null-then-resume path.T> , provided by the WorkflowEventRefWaitExtension extension
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited