View Source SpawnSdk.System behaviour (spawn_sdk v1.0.0-rc.2)

System defines the general behavior of the Spawn actor system. It is through System implementations that the user can register, invoke, and perform other activities with their Actors.

Summary

Types

@type action() :: String.t()
@type actor_mod() :: module()
@type actor_name() :: String.t()
@type actors() :: [actor_mod()]
@type invoke_opts() :: [
  action: action(),
  ref: actor_mod(),
  payload: payload(),
  system: system(),
  async: boolean()
]
@type payload() :: struct()
@type spawn_actor_opts() :: [actor: actor_mod(), system: system()]
@type system() :: String.t()

Callbacks

Link to this callback

invoke(actor_name, invoke_opts)

View Source
@callback invoke(actor_name(), invoke_opts()) :: {:ok, term()} | {:error, term()}
Link to this callback

register(system, actors)

View Source
@callback register(system(), actors()) :: :ok | {:error, term()}
Link to this callback

spawn_actor(actor_name, spawn_actor_opts)

View Source
@callback spawn_actor(actor_name(), spawn_actor_opts()) ::
  {:ok, term()} | {:error, term()}