Interface IAppStateMachineExecutionContext<T>
public interface IAppStateMachineExecutionContext<T> where T : struct, Enum
Type Parameters
T
Properties
Bucket
The state machine bucket name
string Bucket { get; }
Property Value
DeploymentId
The deployment id in which this state machine was submitted
long DeploymentId { get; }
Property Value
FromState
The target state from which the machine is transitioning
T FromState { get; }
Property Value
- T
Progress
Update the progress percentage of this state machine
int Progress { set; }
Property Value
Result
Set the result of this state machine (if any)
object Result { get; set; }
Property Value
- object
RunCount
Time this state has been run/retried
int RunCount { get; }
Property Value
StateId
The current state id
long StateId { get; }
Property Value
StateMachineId
The current state machine id
Guid StateMachineId { get; }
Property Value
Status
Update the progress status of this state machine
string Status { set; }
Property Value
ToState
The target state towards which the machine is transitioning
T ToState { get; }
Property Value
- T
Methods
Cancel()
Cancel fsm
void Cancel()
Cancel(string)
Cancel job
void Cancel(string message)
Parameters
message
string
CompleteAsync(IEnumerable<T>, T, object, CancellationToken, GlowAppScope, AppDataSerializer)
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> CompleteAsync(IEnumerable<T> fromStates, T toState, object data, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json)
Parameters
fromStates
IEnumerable<T>toState
Tdata
objectcancellationToken
CancellationTokenscope
GlowAppScopeserializer
AppDataSerializer
Returns
CompleteAsync(IEnumerable<T>, T, CancellationToken, GlowAppScope)
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> CompleteAsync(IEnumerable<T> fromStates, T toState, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)
Parameters
fromStates
IEnumerable<T>toState
TcancellationToken
CancellationTokenscope
GlowAppScope
Returns
CompleteAsync(T, object, CancellationToken, GlowAppScope, AppDataSerializer)
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> CompleteAsync(T state, object data, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json)
Parameters
state
Tdata
objectcancellationToken
CancellationTokenscope
GlowAppScopeserializer
AppDataSerializer
Returns
CompleteAsync(T, CancellationToken, GlowAppScope)
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> CompleteAsync(T state, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)
Parameters
state
TcancellationToken
CancellationTokenscope
GlowAppScope
Returns
CompleteAsync(T, T, object, CancellationToken, GlowAppScope, AppDataSerializer)
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> CompleteAsync(T fromState, T toState, object data, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json)
Parameters
fromState
TtoState
Tdata
objectcancellationToken
CancellationTokenscope
GlowAppScopeserializer
AppDataSerializer
Returns
CompleteAsync(T, T, CancellationToken, GlowAppScope)
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> CompleteAsync(T fromState, T toState, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)
Parameters
fromState
TtoState
TcancellationToken
CancellationTokenscope
GlowAppScope
Returns
Faulted(Exception)
Mark the fsm as Faulted (Glow will not retry current state)
void Faulted(Exception exception)
Parameters
exception
Exception
Faulted(Exception, string)
Mark the fsm as Faulted (Glow will not retry current state)
void Faulted(Exception exception, string message)
Parameters
Faulted(string)
Mark the fsm as Faulted (Glow will not retry current state)
void Faulted(string message)
Parameters
message
string
GetData<TData>()
Get input data (deserialize)
TData GetData<TData>()
Returns
- TData
Type Parameters
TData
Reschedule(DateTimeOffset)
Reschedule the current state to run at the specified time.
void Reschedule(DateTimeOffset runAtTime)
Parameters
runAtTime
DateTimeOffset
Reschedule(TimeSpan)
Reschedule the job to run after some time from now.
void Reschedule(TimeSpan timespan)
Parameters
timespan
TimeSpan
SetStateAsync(IEnumerable<T>, T, object, CancellationToken, GlowAppScope, AppDataSerializer)
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> SetStateAsync(IEnumerable<T> fromStates, T toState, object data, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json)
Parameters
fromStates
IEnumerable<T>toState
Tdata
objectcancellationToken
CancellationTokenscope
GlowAppScopeserializer
AppDataSerializer
Returns
SetStateAsync(IEnumerable<T>, T, CancellationToken, GlowAppScope)
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> SetStateAsync(IEnumerable<T> fromStates, T toState, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)
Parameters
fromStates
IEnumerable<T>toState
TcancellationToken
CancellationTokenscope
GlowAppScope
Returns
SetStateAsync(T, object, CancellationToken, GlowAppScope, AppDataSerializer)
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> SetStateAsync(T state, object data, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json)
Parameters
state
Tdata
objectcancellationToken
CancellationTokenscope
GlowAppScopeserializer
AppDataSerializer
Returns
SetStateAsync(T, CancellationToken, GlowAppScope)
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> SetStateAsync(T state, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)
Parameters
state
TcancellationToken
CancellationTokenscope
GlowAppScope
Returns
SetStateAsync(T, T, object, CancellationToken, GlowAppScope, AppDataSerializer)
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> SetStateAsync(T fromState, T toState, object data, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json)
Parameters
fromState
TtoState
Tdata
objectcancellationToken
CancellationTokenscope
GlowAppScopeserializer
AppDataSerializer
Returns
SetStateAsync(T, T, CancellationToken, GlowAppScope)
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> SetStateAsync(T fromState, T toState, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)
Parameters
fromState
TtoState
TcancellationToken
CancellationTokenscope
GlowAppScope