Table of Contents

Interface IAppStateMachineService

Namespace
Phoesion.Glow.SDK.Firefly
Assembly
Phoesion.Glow.SDK.Firefly.Abstractions.dll

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 Guid

The FSM Id

fromStates IEnumerable<T>

The states that FSM must be to accept the new state request.

toState T

The state to set the FSM

data object

The state data to use for state change

cancellationToken CancellationToken

Cancel operation

scope GlowAppScope

The 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 AppDataSerializer

Serialize to use for data

Returns

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

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 Guid

The FSM Id

fromStates IEnumerable<T>

The states that FSM must be to accept the new state request.

toState T

The state to set the FSM

cancellationToken CancellationToken

Cancel operation

scope GlowAppScope

The 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

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

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 Guid

The FSM Id

state T

The state to set the FSM

data object

The state data to use for state change

cancellationToken CancellationToken

Cancel operation

scope GlowAppScope

The 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 AppDataSerializer

Serialize to use for data

Returns

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

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 Guid

The FSM Id

state T

The state to set the FSM

cancellationToken CancellationToken

Cancel operation

scope GlowAppScope

The 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

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

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 Guid

The FSM Id

fromState T

The state that FSM must be to accept the new state request.

toState T

The state to set the FSM

data object

The state data to use for state change

cancellationToken CancellationToken

Cancel operation

scope GlowAppScope

The 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 AppDataSerializer

Serialize to use for data

Returns

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

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 Guid

The FSM Id

fromState T

The state that FSM must be to accept the new state request.

toState T

The state to set the FSM

cancellationToken CancellationToken

Cancel operation

scope GlowAppScope

The 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

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

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 T

The state to initialize the new machine

initStateData object

The state data to initialize the new machine

cancellationToken CancellationToken

Cancel operation

scope GlowAppScope

The 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 AppDataSerializer

Serialize to use for data

Returns

IAppStateMachineService.IAppStateMachineCreateBuilder

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 T

The state to initialize the new machine

cancellationToken CancellationToken

Cancel operation

scope GlowAppScope

The 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

IAppStateMachineService.IAppStateMachineCreateBuilder

Type Parameters

T

ManageBucket(string, GlowAppScope)

Manage bucket

IAppStateMachineService.IAppStateMachineBucketManagment ManageBucket(string bucket, GlowAppScope scope = GlowAppScope.Service)

Parameters

bucket string

The bucket name

scope GlowAppScope

The 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

IAppStateMachineService.IAppStateMachineBucketManagment

ManageBucket(Type, GlowAppScope)

Manage bucket

IAppStateMachineService.IAppStateMachineBucketManagment ManageBucket(Type fsmType, GlowAppScope scope = GlowAppScope.Service)

Parameters

fsmType Type

The state-machine type to manage

scope GlowAppScope

The 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

IAppStateMachineService.IAppStateMachineBucketManagment

ManageBucket<TStateMachineType>(GlowAppScope)

Manage bucket

IAppStateMachineService.IAppStateMachineBucketManagment ManageBucket<TStateMachineType>(GlowAppScope scope = GlowAppScope.Service)

Parameters

scope GlowAppScope

The 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

IAppStateMachineService.IAppStateMachineBucketManagment

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 Guid

The state-machine to manage

scope GlowAppScope

The 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

IAppStateMachineService.IAppStateMachineManagment<T>

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 Guid

The FSM Id

fromStates IEnumerable<T>

The states that FSM must be to accept the new state request.

toState T

The state to set the FSM

data object

The state data to use for state change

cancellationToken CancellationToken

Cancel operation

scope GlowAppScope

The 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 AppDataSerializer

Serialize to use for data

Returns

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

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 Guid

The FSM Id

fromStates IEnumerable<T>

The states that FSM must be to accept the new state request.

toState T

The state to set the FSM

cancellationToken CancellationToken

Cancel operation

scope GlowAppScope

The 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

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

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 Guid

The FSM Id

state T

The state to set the FSM

data object

The state data to use for state change

cancellationToken CancellationToken

Cancel operation

scope GlowAppScope

The 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 AppDataSerializer

Serialize to use for data

Returns

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

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 Guid

The FSM Id

state T

The state to set the FSM

cancellationToken CancellationToken

Cancel operation

scope GlowAppScope

The 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

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

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 Guid

The FSM Id

fromState T

The state that FSM must be to accept the new state request.

toState T

The state to set the FSM

data object

The state data to use for state change

cancellationToken CancellationToken

Cancel operation

scope GlowAppScope

The 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 AppDataSerializer

Serialize to use for data

Returns

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

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 Guid

The FSM Id

fromState T

The state that FSM must be to accept the new state request.

toState T

The state to set the FSM

cancellationToken CancellationToken

Cancel operation

scope GlowAppScope

The 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

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

Type Parameters

T