### Class

# Dex StateMachine

#### Description [src]

    final class Dex.StateMachine : GObject.TypeInstance
    {
      /* No available fields */
    }

`DexStateMachine` provides a serialized asynchronous state machine.

Transitions are declared up front with a static table of `DexStateTransition` entries. Requests made with `dex_state_machine_transition()` are serialized through an internal `DexLimiter` 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.

#### Ancestors

- DexObject

#### Constructors

###### dex_state_machine_new

Creates a new `DexStateMachine`.

#### Instance methods

###### dex_state_machine_get_requested_state

Gets the most recent valid state requested with `dex_state_machine_transition()`.

unstable since: 1.2

###### dex_state_machine_get_state

Gets the current state of `state_machine`.

###### dex_state_machine_interrupt

Cooperatively interrupts the active transition callback.

unstable since: 1.2

###### dex_state_machine_transition

Requests a transition to `target`.

###### dex_state_machine_wait_for_state

Waits until `state_machine` enters `state`.

unstable since: 1.2

##### Methods inherited from DexObject (2)

###### dex_ref

Acquires a reference on the given object, and increases its reference count by one.

###### dex_unref

Releases a reference on the given object, and decreases its reference count by one.