corda / net.corda.node.services.statemachine / FlowStateMachineImpl

FlowStateMachineImpl

class FlowStateMachineImpl<R> : Fiber<Unit>, FlowStateMachine<R>

Constructors

<init> FlowStateMachineImpl(id: StateMachineRunId, logic: FlowLogic<R>, scheduler: FiberScheduler)

Properties

id val id: StateMachineRunId
logger val logger: Logger
logic val logic: FlowLogic<R>
resultFuture val resultFuture: ListenableFuture<R>

This future will complete when the call method returns.

serviceHub lateinit var serviceHub: ServiceHubInternal

Functions

receive fun <T : Any> receive(receiveType: Class<T>, otherParty: Party, sessionFlow: FlowLogic<*>): UntrustworthyData<T>
run fun run(): Unit
send fun send(otherParty: Party, payload: Any, sessionFlow: FlowLogic<*>): Unit
sendAndReceive fun <T : Any> sendAndReceive(receiveType: Class<T>, otherParty: Party, payload: Any, sessionFlow: FlowLogic<*>): UntrustworthyData<T>

Companion Object Functions

currentStateMachine fun currentStateMachine(): FlowStateMachineImpl<*>?

Return the current FlowStateMachineImpl or null if executing outside of one.

Extension Functions

getOrThrow fun <T> Future<T>.getOrThrow(timeout: Duration? = null): T

Same as Future.get but with a more descriptive name, and doesn't throw ExecutionException, instead throwing its cause