AttractorEx.Interviewer behaviour (attractor_phoenix v0.1.0)

Copy Markdown View Source

Behaviour for human-in-the-loop adapters used by wait.human.

Interviewers can source answers from a console, queue, callback, HTTP workflow, or any custom adapter that implements the callbacks below.

Summary

Callbacks

ask(t, list, map, keyword)

@callback ask(AttractorEx.Node.t(), [map()], map(), keyword()) ::
  {:ok, term()} | {:timeout} | {:skip} | {:error, term()} | term() | nil

ask_multiple(t, list, map, keyword)

(optional)
@callback ask_multiple(AttractorEx.Node.t(), [map()], map(), keyword()) ::
  {:ok, [term()]} | {:timeout} | {:skip} | {:error, term()} | term() | nil

inform(t, map, map, keyword)

(optional)
@callback inform(AttractorEx.Node.t(), map(), map(), keyword()) ::
  :ok | {:ok, term()} | {:error, term()} | term()