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

Process

Link to this section Summary

Callbacks

Invoked when process is started, after events and gateways init, see Flexflow.Api.init/1

Module name

Link to this section Types

Specs

definition() :: {:event | :gateway, Flexflow.identity()}

Specs

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

Init result

Specs

state() :: :paused | :waiting | :loop | :active | :created

Specs

t() :: %Flexflow.Process{
  __args__: Flexflow.process_args(),
  __context__: Flexflow.Context.t(),
  __counter__: integer(),
  __definitions__: [definition()],
  __graphviz__: Keyword.t(),
  __loop__: integer(),
  __opts__: Keyword.t(),
  __tasks__: %{required(reference()) => term()},
  __vsn__: [{module(), term()}],
  events: %{required(Flexflow.identity()) => Flexflow.Event.t()},
  gateways: %{required(Flexflow.identity()) => Flexflow.Gateway.t()},
  id: Flexflow.id() | nil,
  module: module(),
  name: Flexflow.name(),
  state: state()
}

Link to this section Functions

Specs

after_init(t()) :: result()
Link to this function

async(p, f, callback, value, opts \\ [])

View Source

Specs

async(t(), (() -> r), (arg, t(), :ok | :error, r -> result()), arg, Keyword.t()) ::
  t()
when arg: term(), r: term()
Link to this macro

event(key, opts \\ [])

View Source (macro)
Link to this macro

gateway(key, tuple, opts \\ [])

View Source (macro)
Link to this function

handle_call(p, input, from \\ nil)

View Source

Specs

handle_call(t(), term(), GenServer.from() | nil) :: result()

Specs

handle_cast(t(), term()) :: result()

Specs

handle_info(t(), term()) :: result()

Specs

init(t()) :: result()

Specs

loop(t()) :: result()
Link to this function

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

View Source

Specs

Specs

next(t()) :: result()

Specs

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

Link to this section Callbacks

Link to this callback

handle_call(t, term, arg3)

View Source (optional)

Specs

handle_call(t(), term(), GenServer.from()) :: result()
Link to this callback

handle_cast(t, term)

View Source (optional)

Specs

handle_cast(t(), term()) :: result()
Link to this callback

handle_info(t, term)

View Source (optional)

Specs

handle_info(t(), term()) :: result()

Specs

init(t()) :: result()

Invoked when process is started, after events and gateways init, see Flexflow.Api.init/1

Specs

name() :: Flexflow.name()

Module name

Link to this callback

terminate(t, term)

View Source (optional)

Specs

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