Tai.Advisor behaviour (tai v0.0.64)

A behavior for implementing a server that receives events such as market quotes.

It can be used to receive one or more quote streams to record data and create, update or cancel orders.

Link to this section Summary

Link to this section Types

Link to this type

advisor_name()

Specs

advisor_name() :: atom()
Link to this type

advisor_spec()

Specs

advisor_spec() :: Tai.Advisors.Spec.t()

Specs

event() :: term()

Specs

group_id() :: Tai.AdvisorGroup.id()

Specs

Specs

run_store() :: Tai.Advisor.State.run_store()

Specs

state() :: Tai.Advisor.State.t()
Link to this type

terminate_reason()

Specs

terminate_reason() :: :normal | :shutdown | {:shutdown, term()} | term()

Link to this section Functions

Link to this function

child_spec(advisor_spec)

Specs

child_spec(advisor_spec()) :: Supervisor.child_spec()
Link to this function

process_name(group_id, advisor_id)

Specs

process_name(group_id(), id()) :: advisor_name()

Link to this section Callbacks

Link to this callback

after_start(state)

Specs

after_start(state()) :: {:ok, run_store()}
Link to this callback

handle_event(event, state)

Specs

handle_event(event(), state()) :: {:ok, run_store()}
Link to this callback

on_terminate(terminate_reason, state)

Specs

on_terminate(terminate_reason(), state()) :: term()