Interface IAppStateMachineService
Build-in distributed finite state machine service.
public interface IAppStateMachineService
Methods
CompleteAsync<T>(Guid, IEnumerable<T>, T, object, CancellationToken, GlowAppScope, AppDataSerializer)
Request to change State-Machine's state to Completed.
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> CompleteAsync<T>(Guid fsmId, IEnumerable<T> fromStates, T toState, object data, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json) where T : struct, Enum
Parameters
fsmId
GuidThe FSM Id
fromStates
IEnumerable<T>The states that FSM must be to accept the new state request.
toState
TThe state to set the FSM
data
objectThe state data to use for state change
cancellationToken
CancellationTokenCancel operation
scope
GlowAppScopeThe scope of the state machine.
- QuantumSpace scope means the state machine is shared with other services in the same QuantumSpace.
- Service scope means this state machine is only visible to other instances of the same service.
serializer
AppDataSerializerSerialize to use for data
Returns
Type Parameters
T
CompleteAsync<T>(Guid, IEnumerable<T>, T, CancellationToken, GlowAppScope)
Request to change State-Machine's state to Completed.
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> CompleteAsync<T>(Guid fsmId, IEnumerable<T> fromStates, T toState, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service) where T : struct, Enum
Parameters
fsmId
GuidThe FSM Id
fromStates
IEnumerable<T>The states that FSM must be to accept the new state request.
toState
TThe state to set the FSM
cancellationToken
CancellationTokenCancel operation
scope
GlowAppScopeThe scope of the state machine.
- QuantumSpace scope means the state machine is shared with other services in the same QuantumSpace.
- Service scope means this state machine is only visible to other instances of the same service.
Returns
Type Parameters
T
CompleteAsync<T>(Guid, T, object, CancellationToken, GlowAppScope, AppDataSerializer)
Request to change State-Machine's state to Completed.
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> CompleteAsync<T>(Guid fsmId, T state, object data, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json) where T : struct, Enum
Parameters
fsmId
GuidThe FSM Id
state
TThe state to set the FSM
data
objectThe state data to use for state change
cancellationToken
CancellationTokenCancel operation
scope
GlowAppScopeThe scope of the state machine.
- QuantumSpace scope means the state machine is shared with other services in the same QuantumSpace.
- Service scope means this state machine is only visible to other instances of the same service.
serializer
AppDataSerializerSerialize to use for data
Returns
Type Parameters
T
CompleteAsync<T>(Guid, T, CancellationToken, GlowAppScope)
Request to change State-Machine's state to Completed.
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> CompleteAsync<T>(Guid fsmId, T state, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service) where T : struct, Enum
Parameters
fsmId
GuidThe FSM Id
state
TThe state to set the FSM
cancellationToken
CancellationTokenCancel operation
scope
GlowAppScopeThe scope of the state machine.
- QuantumSpace scope means the state machine is shared with other services in the same QuantumSpace.
- Service scope means this state machine is only visible to other instances of the same service.
Returns
Type Parameters
T
CompleteAsync<T>(Guid, T, T, object, CancellationToken, GlowAppScope, AppDataSerializer)
Request to change State-Machine's state to Completed.
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> CompleteAsync<T>(Guid fsmId, T fromState, T toState, object data, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json) where T : struct, Enum
Parameters
fsmId
GuidThe FSM Id
fromState
TThe state that FSM must be to accept the new state request.
toState
TThe state to set the FSM
data
objectThe state data to use for state change
cancellationToken
CancellationTokenCancel operation
scope
GlowAppScopeThe scope of the state machine.
- QuantumSpace scope means the state machine is shared with other services in the same QuantumSpace.
- Service scope means this state machine is only visible to other instances of the same service.
serializer
AppDataSerializerSerialize to use for data
Returns
Type Parameters
T
CompleteAsync<T>(Guid, T, T, CancellationToken, GlowAppScope)
Request to change State-Machine's state to Completed.
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> CompleteAsync<T>(Guid fsmId, T fromState, T toState, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service) where T : struct, Enum
Parameters
fsmId
GuidThe FSM Id
fromState
TThe state that FSM must be to accept the new state request.
toState
TThe state to set the FSM
cancellationToken
CancellationTokenCancel operation
scope
GlowAppScopeThe scope of the state machine.
- QuantumSpace scope means the state machine is shared with other services in the same QuantumSpace.
- Service scope means this state machine is only visible to other instances of the same service.
Returns
Type Parameters
T
CreateAsync<T>(T, object, CancellationToken, GlowAppScope, AppDataSerializer)
Create a new state machine
IAppStateMachineService.IAppStateMachineCreateBuilder CreateAsync<T>(T initState, object initStateData, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json) where T : struct, Enum
Parameters
initState
TThe state to initialize the new machine
initStateData
objectThe state data to initialize the new machine
cancellationToken
CancellationTokenCancel operation
scope
GlowAppScopeThe scope of the state machine.
- QuantumSpace scope means the state machine is shared with other services in the same QuantumSpace.
- Service scope means this state machine is only visible to other instances of the same service.
serializer
AppDataSerializerSerialize to use for data
Returns
Type Parameters
T
CreateAsync<T>(T, CancellationToken, GlowAppScope)
Create a new state machine
IAppStateMachineService.IAppStateMachineCreateBuilder CreateAsync<T>(T initState, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service) where T : struct, Enum
Parameters
initState
TThe state to initialize the new machine
cancellationToken
CancellationTokenCancel operation
scope
GlowAppScopeThe scope of the state machine.
- QuantumSpace scope means the state machine is shared with other services in the same QuantumSpace.
- Service scope means this state machine is only visible to other instances of the same service.
Returns
Type Parameters
T
ManageBucket(string, GlowAppScope)
Manage bucket
IAppStateMachineService.IAppStateMachineBucketManagment ManageBucket(string bucket, GlowAppScope scope = GlowAppScope.Service)
Parameters
bucket
stringThe bucket name
scope
GlowAppScopeThe scope of the bucket.
- QuantumSpace scope means the bucket is shared with other services in the same QuantumSpace.
- Service scope means this bucket is only visible to other instances of the same service.
Returns
ManageBucket(Type, GlowAppScope)
Manage bucket
IAppStateMachineService.IAppStateMachineBucketManagment ManageBucket(Type fsmType, GlowAppScope scope = GlowAppScope.Service)
Parameters
fsmType
TypeThe state-machine type to manage
scope
GlowAppScopeThe scope of the bucket.
- QuantumSpace scope means the bucket is shared with other services in the same QuantumSpace.
- Service scope means this bucket is only visible to other instances of the same service.
Returns
ManageBucket<TStateMachineType>(GlowAppScope)
Manage bucket
IAppStateMachineService.IAppStateMachineBucketManagment ManageBucket<TStateMachineType>(GlowAppScope scope = GlowAppScope.Service)
Parameters
scope
GlowAppScopeThe scope of the bucket.
- QuantumSpace scope means the bucket is shared with other services in the same QuantumSpace.
- Service scope means this bucket is only visible to other instances of the same service.
Returns
Type Parameters
TStateMachineType
ManageStateMachine<T>(Guid, GlowAppScope)
Manage a state-machine
IAppStateMachineService.IAppStateMachineManagment<T> ManageStateMachine<T>(Guid fsmId, GlowAppScope scope = GlowAppScope.Service) where T : struct, Enum
Parameters
fsmId
GuidThe state-machine to manage
scope
GlowAppScopeThe scope of the bucket.
- QuantumSpace scope means the bucket is shared with other services in the same QuantumSpace.
- Service scope means this bucket is only visible to other instances of the same service.
Returns
Type Parameters
T
SetStateAsync<T>(Guid, IEnumerable<T>, T, object, CancellationToken, GlowAppScope, AppDataSerializer)
Change State-Machine's state.
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> SetStateAsync<T>(Guid fsmId, IEnumerable<T> fromStates, T toState, object data, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json) where T : struct, Enum
Parameters
fsmId
GuidThe FSM Id
fromStates
IEnumerable<T>The states that FSM must be to accept the new state request.
toState
TThe state to set the FSM
data
objectThe state data to use for state change
cancellationToken
CancellationTokenCancel operation
scope
GlowAppScopeThe scope of the state machine.
- QuantumSpace scope means the state machine is shared with other services in the same QuantumSpace.
- Service scope means this state machine is only visible to other instances of the same service.
serializer
AppDataSerializerSerialize to use for data
Returns
Type Parameters
T
SetStateAsync<T>(Guid, IEnumerable<T>, T, CancellationToken, GlowAppScope)
Change State-Machine's state.
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> SetStateAsync<T>(Guid fsmId, IEnumerable<T> fromStates, T toState, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service) where T : struct, Enum
Parameters
fsmId
GuidThe FSM Id
fromStates
IEnumerable<T>The states that FSM must be to accept the new state request.
toState
TThe state to set the FSM
cancellationToken
CancellationTokenCancel operation
scope
GlowAppScopeThe scope of the state machine.
- QuantumSpace scope means the state machine is shared with other services in the same QuantumSpace.
- Service scope means this state machine is only visible to other instances of the same service.
Returns
Type Parameters
T
SetStateAsync<T>(Guid, T, object, CancellationToken, GlowAppScope, AppDataSerializer)
Change State-Machine's state.
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> SetStateAsync<T>(Guid fsmId, T state, object data, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json) where T : struct, Enum
Parameters
fsmId
GuidThe FSM Id
state
TThe state to set the FSM
data
objectThe state data to use for state change
cancellationToken
CancellationTokenCancel operation
scope
GlowAppScopeThe scope of the state machine.
- QuantumSpace scope means the state machine is shared with other services in the same QuantumSpace.
- Service scope means this state machine is only visible to other instances of the same service.
serializer
AppDataSerializerSerialize to use for data
Returns
Type Parameters
T
SetStateAsync<T>(Guid, T, CancellationToken, GlowAppScope)
Change State-Machine's state.
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> SetStateAsync<T>(Guid fsmId, T state, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service) where T : struct, Enum
Parameters
fsmId
GuidThe FSM Id
state
TThe state to set the FSM
cancellationToken
CancellationTokenCancel operation
scope
GlowAppScopeThe scope of the state machine.
- QuantumSpace scope means the state machine is shared with other services in the same QuantumSpace.
- Service scope means this state machine is only visible to other instances of the same service.
Returns
Type Parameters
T
SetStateAsync<T>(Guid, T, T, object, CancellationToken, GlowAppScope, AppDataSerializer)
Change State-Machine's state.
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> SetStateAsync<T>(Guid fsmId, T fromState, T toState, object data, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json) where T : struct, Enum
Parameters
fsmId
GuidThe FSM Id
fromState
TThe state that FSM must be to accept the new state request.
toState
TThe state to set the FSM
data
objectThe state data to use for state change
cancellationToken
CancellationTokenCancel operation
scope
GlowAppScopeThe scope of the state machine.
- QuantumSpace scope means the state machine is shared with other services in the same QuantumSpace.
- Service scope means this state machine is only visible to other instances of the same service.
serializer
AppDataSerializerSerialize to use for data
Returns
Type Parameters
T
SetStateAsync<T>(Guid, T, T, CancellationToken, GlowAppScope)
Change State-Machine's state.
IAppStateMachineService.IAppStateMachineSetStateBuilder<T> SetStateAsync<T>(Guid fsmId, T fromState, T toState, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service) where T : struct, Enum
Parameters
fsmId
GuidThe FSM Id
fromState
TThe state that FSM must be to accept the new state request.
toState
TThe state to set the FSM
cancellationToken
CancellationTokenCancel operation
scope
GlowAppScopeThe scope of the state machine.
- QuantumSpace scope means the state machine is shared with other services in the same QuantumSpace.
- Service scope means this state machine is only visible to other instances of the same service.
Returns
Type Parameters
T