Table of Contents

Class RuntimeStateStreamConverter

Namespace
DurableTask.Core.Serializing
Assembly
DurableTask.Core.dll

A converter that does conversion between the OrchestrationRuntimeState instance and a stream after serialization. The stream is a serialized OrchestrationSessionState that will set as session state. De-serialization is done with fallbacks in the order: OrchestrationSessionState -> OrchestrationRuntimeState -> IList of HistoryEvent.

public class RuntimeStateStreamConverter
Inheritance
RuntimeStateStreamConverter
Inherited Members

Constructors

RuntimeStateStreamConverter()

public RuntimeStateStreamConverter()

Methods

OrchestrationRuntimeStateToRawStream(OrchestrationRuntimeState, OrchestrationRuntimeState, DataConverter, bool, ISessionSettings, IOrchestrationServiceBlobStore, string)

Convert an OrchestrationRuntimeState instance to a serialized raw stream to be saved in session state.

public static Task<Stream> OrchestrationRuntimeStateToRawStream(OrchestrationRuntimeState newOrchestrationRuntimeState, OrchestrationRuntimeState runtimeState, DataConverter dataConverter, bool shouldCompress, ISessionSettings serviceBusSessionSettings, IOrchestrationServiceBlobStore orchestrationServiceBlobStore, string sessionId)

Parameters

newOrchestrationRuntimeState OrchestrationRuntimeState

The new OrchestrationRuntimeState to be serialized

runtimeState OrchestrationRuntimeState

The current runtime state

dataConverter DataConverter

A data converter for serialization and deserialization

shouldCompress bool

True if should compress when serialization

serviceBusSessionSettings ISessionSettings

The service bus session settings

orchestrationServiceBlobStore IOrchestrationServiceBlobStore

A blob store for external blob storage

sessionId string

The session id

Returns

Task<Stream>

A serialized raw stream to be saved in session state

RawStreamToRuntimeState(Stream, string, IOrchestrationServiceBlobStore, DataConverter)

Convert a raw stream to an orchestration runtime state instance.

public static Task<OrchestrationRuntimeState> RawStreamToRuntimeState(Stream rawSessionStream, string sessionId, IOrchestrationServiceBlobStore orchestrationServiceBlobStore, DataConverter dataConverter)

Parameters

rawSessionStream Stream

The raw session stream to be deserialized

sessionId string

The session Id

orchestrationServiceBlobStore IOrchestrationServiceBlobStore

A blob store for external blob storage

dataConverter DataConverter

A data converter for serialization and deserialization

Returns

Task<OrchestrationRuntimeState>