Class WorkflowStream
- Namespace
- Temporalio.Extensions.WorkflowStreams
- Assembly
- Temporalio.Extensions.WorkflowStreams.dll
A durable, offset-addressed, multi-topic log hosted inside a Temporal workflow.
public sealed class WorkflowStream
- Inheritance
-
WorkflowStream
- Inherited Members
Remarks
Construct one instance during workflow initialization. WARNING: Workflow Streams is experimental and may change.
Constructors
WorkflowStream()
Initializes a new instance of the WorkflowStream class.
public WorkflowStream()
WorkflowStream(WorkflowStreamState?)
Initializes a new instance of the WorkflowStream class.
public WorkflowStream(WorkflowStreamState? state)
Parameters
stateWorkflowStreamStateState captured before continue-as-new, or null for a new stream.
WorkflowStream(WorkflowStreamState?, WorkflowStreamOptions?)
Initializes a new instance of the WorkflowStream class.
public WorkflowStream(WorkflowStreamState? state, WorkflowStreamOptions? options)
Parameters
stateWorkflowStreamStateState captured before continue-as-new, or null for a new stream.
optionsWorkflowStreamOptionsStream options, snapshotted by this constructor.
Methods
CaptureStateForContinueAsNewAsync()
Detaches pollers, waits for handlers, and captures state for continue-as-new.
public Task<WorkflowStreamState> CaptureStateForContinueAsNewAsync()
Returns
- Task<WorkflowStreamState>
The final stream state to pass to the next workflow run.
DetachPollers()
Unblocks admitted pollers and rejects new polls during continue-as-new.
public void DetachPollers()
GetState()
Captures retained state using the configured publisher time-to-live.
public WorkflowStreamState GetState()
Returns
- WorkflowStreamState
A cross-language state snapshot.
GetState(TimeSpan)
Captures retained state with a specific publisher time-to-live.
public WorkflowStreamState GetState(TimeSpan publisherTtl)
Parameters
publisherTtlTimeSpanAge after which publisher deduplication state is omitted.
Returns
- WorkflowStreamState
A cross-language state snapshot.
GetTopic(string?)
Creates a workflow-side publisher for a topic.
public WorkflowStreamTopicHandle GetTopic(string? name)
Parameters
namestringTopic name. Null is represented by the empty topic.
Returns
- WorkflowStreamTopicHandle
A topic handle.
GetTopic<T>(string?)
Creates a strongly typed workflow-side publisher for a topic.
public WorkflowStreamTopicHandle<T> GetTopic<T>(string? name)
Parameters
namestringTopic name. Null is represented by the empty topic.
Returns
- WorkflowStreamTopicHandle<T>
A topic handle.
Type Parameters
TType of values published to the topic.
Truncate(long)
Discards entries before a global offset.
public void Truncate(long upToOffset)
Parameters
upToOffsetlongThe first offset to retain.