SignalconnectSignalconnect_SignalemitSince 1.2get_Gets the most recent valid state requested with Dex.StateMachine.transition.
The requested state is initialized to the initial state passed to Dex.StateMachine.new. It is updated immediately when Dex.StateMachine.transition is called with a valid target state, before that transition is run. It is not a guarantee that the transition will run or succeed, and it may differ from the current state returned by Dex.StateMachine.get_state.
the most recent valid requested state
Gets the current state of state_machine.
the current state
Since 1.2interruptCooperatively interrupts the active transition callback.
If a transition callback is currently active, its interrupt future returned by Dex.StateTransitionContext.wait_for_interrupt is resolved. This does not request a transition or change the current state; the active callback decides how to handle the interrupt.
true if an active transition context was marked interrupted; otherwise false
Requests a transition to target.
If target is a valid value for the state machine's enum type, it becomes
the requested state immediately and can be read with
Dex.StateMachine.get_requested_state. The requested state is the
most recent valid target passed to this method. It may differ from the
current state and does not imply that the transition will succeed.
Transition requests are serialized. The matching callback is run from a
fiber and may use dex_await() to wait for asynchronous work. If the
callback succeeds without calling
Dex.StateTransitionContext.set_state, the state machine commits
target. If the callback updates the state directly, the returned future
resolves to the current state after the callback returns.
the target state
a future resolving to the final enum state
Since 1.2wait_Waits until state_machine enters state.
If state_machine is already in state, the returned future is already
resolved. Otherwise, the future resolves the next time the current state is
set to state. This does not request a transition; use
Dex.StateMachine.transition to move the state machine.
the state to wait for
a future resolving to state
Releases a reference on the given object, and decreases its reference count by one.
If it was the last reference, the resources associated to the instance are freed.
Dex.StateMachine provides a serialized asynchronous state machine.
Transitions are declared up front with a static table of Dex.StateTransition entries. Requests made with Dex.StateMachine.transition are serialized through an internal Dex.Limiter with a max concurrency of one. Transition callbacks run from a fiber, so they may use
dex_await()and related APIs while still appearing as synchronous functions.