Flexflow.Process behaviour (flexflow v0.2.0) View Source

Process

Link to this section Summary

Link to this section Types

Specs

action() :: :gen_statem.action()

Specs

definition() ::
  {:states, Flexflow.state_key()}
  | {:events, {Flexflow.state_key(), Flexflow.state_key()}}

Specs

event_result() ::
  :ignore
  | result()
  | {:ok, Flexflow.State.t()}
  | {:ok, Flexflow.State.t(), [action()]}

Specs

event_type() :: :gen_statem.event_type()

Specs

process_tuple() :: {module(), Flexflow.name()}

Specs

result() :: {:ok, t()} | {:error, term()}

Init result

Specs

state_result() :: :ignore | result() | {:ok, Flexflow.State.t()}

Specs

t() :: %Flexflow.Process{
  __actions__: [action()],
  __args__: Flexflow.process_args(),
  __counter__: integer(),
  __definitions__: [definition()],
  __listeners__: %{
    required(Flexflow.EventDispatcher.listener()) =>
      Flexflow.EventDispatcher.listen_result()
  },
  __loop__: integer(),
  __opts__: Keyword.t(),
  __tasks__: %{required(reference()) => term()},
  __vsn__: [{module(), term()}],
  childs: [Flexflow.process_key()],
  context: Flexflow.Context.t(),
  events: %{required(Flexflow.state_key()) => Flexflow.Event.t()},
  id: Flexflow.id() | nil,
  module: module(),
  name: Flexflow.name(),
  parent: Flexflow.process_key(),
  request_id: String.t(),
  state: Flexflow.state_key(),
  states: %{required(Flexflow.state_key()) => Flexflow.State.t()}
}

Link to this section Functions

Link to this macro

event(key, tuple)

View Source (macro)
Link to this macro

event(key, tuple, opts)

View Source (macro)
Link to this macro

event(key, tuple, opts, block)

View Source (macro)
Link to this function

handle_event(event_type, to, process)

View Source

Specs

handle_event(:enter, Flexflow.state_key(), t()) :: result()
handle_event(event_type(), term(), t()) :: result()
Link to this function

init(module, id, args \\ %{})

View Source

Specs

Link to this function

new(module, id, args \\ %{})

View Source

Specs

new(module(), Flexflow.id(), Flexflow.process_args()) :: {:ok, t()}
Link to this function

parse_result(arg1, process)

View Source
Link to this macro

state(key, opts)

View Source (macro)
Link to this macro

state(key, opts, block)

View Source (macro)

Link to this section Callbacks

Specs

handle_result(term(), t()) :: result()

Specs

init(t()) :: result()

Specs

name() :: Flexflow.name()

Module name

Link to this callback

terminate(term, t)

View Source (optional)

Specs

terminate(term(), t()) :: term()