View Source Actors (spawn v0.6.0)

Actors It's the client API for the Spawn actors. Through this module we interact with the actors by creating, invoking or configuring them.

Link to this section Summary

Link to this section Functions

Link to this function

get_state(system_name, actor_name)

View Source
@spec get_state(String.t(), String.t()) :: {:ok, term()} | {:error, term()}
Link to this function

invoke(request, opts \\ [])

View Source

Makes a request to an actor.

  • request - The InvocationRequest
  • opts - The options to Invoke Actors ##
Link to this function

register(registration, opts \\ [])

View Source
@spec register(Eigr.Functions.Protocol.RegistrationRequest.t(), any()) ::
  {:ok, Eigr.Functions.Protocol.RegistrationResponse.t()}
  | {:error, Eigr.Functions.Protocol.RegistrationResponse.t()}

Registers all actors defined in HostActor.

  • registration - The RegistrationRequest
  • opts - The options to create Actors ##
Link to this function

spawn_actor(spawn, opts \\ [])

View Source
@spec spawn_actor(Eigr.Functions.Protocol.SpawnRequest.t(), any()) ::
  {:ok, Eigr.Functions.Protocol.SpawnResponse.t()}

Spawn actors defined in HostActor.

  • registration - The SpawnRequest
  • opts - The options to create Actors

spawn_actor must be used when you want to create a concrete instance of an actor previously registered as abstract. That is, when an Actorid is associated with an actor of abstract type. This function only registers the metadata of the new actor, not activating it. This will occur when the sprite is first invoked. ##

Link to this function

try_reactivate_actor(system, actor, opts \\ [])

View Source
@spec try_reactivate_actor(
  Eigr.Functions.Protocol.Actors.ActorSystem.t(),
  Eigr.Functions.Protocol.Actors.Actor.t(),
  any()
) :: {:ok, any()} | {:error, any()}