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

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.

Link to this section Summary

Link to this section Types

@type actor_mod() :: module()
@type actor_name() :: String.t()
@type actors() :: [actor_mod()]
@type command() :: String.t()
@type invoke_opts() :: [
  command: command(),
  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()

Link to this section 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()}