API Reference Maxine v0.2.6


Functions for dealing with machines: to wit, generate/2, which creates an initial %State{} struct from a %Machine{}, and advance/3 (along with companion advance!/3) which transforms one %State{} into another one according to the rules given in the machine.

Helper functions for use in callbacks. These get their own module because they really don't belong with generate/2 and advance/3. The idea is that you

Compose individual machines using the optional DeepMerge dependency.

Where we put application data; the only way for callbacks to communicate with the outside world. Note that at each event, :tmp is wiped and :options is updated to reflect whatever the current event was called with.

Ecto bindings for Maxine. Provides

The various types of failure we may encounter.

For failures in the callback phase. For use by callbacks themselves; we don't call this one directly here. Use cause to wrap a more specific error.

When a machine returns something other than a %Data{} or a %CallbackError.

Called when the underlying machine is faulty and causes something unhandleable in the API.

When a machine requests a non-existent callback function.

On a non-existent event.

When the event has no transition mapped for the present state.

The actual machine structure

Sentinel values used by Maxine to signal that no further event has been requested, (Halt) and that no transition for the current state was found for a given name of that state, and resolve_next_state should keep looking under the state's other names (Pass).

The "state" part of "state machine." These are the structs we actually pass around, call events on, and transform in the course of normal use.