View Source Actors.Registry.ActorRegistry (spawn v0.5.0)

The ActorRegistry module provides a registry for actor entities.

It allows for registering and looking up actors and also provides methods for adding and removing invocation requests for actors.

Link to this section Summary

Functions

Get all invocations stored for actor

Fetch current entities of the service. Returns HostActor with Host and specific actor.

Register member entities to the ActorRegistry. Returns Cluster with all Host members.

Registers a invocation request in CRDT Database Usually used for invocation schedulings

Removes a invocation request in CRDT Database Usually used for invocation schedulings

Link to this section Functions

Get all invocations stored for actor

examples

Examples

iex> ActorRegistry.get_all_invocations()
[<<10, 14, 10, 12, 115, 112>>]
Link to this function

get_hosts_by_actor(system_name, actor_name)

View Source
@spec get_hosts_by_actor(String.t(), String.t()) ::
  {:ok, Member.t()} | {:not_found, []}
Link to this function

get_hosts_by_actor_parent(system_name, actor_name)

View Source
@spec get_hosts_by_actor_parent(String.t(), String.t()) ::
  {:ok, Member.t()} | {:not_found, []}
Link to this function

lookup(system_name, actor_name, opts \\ [])

View Source (since 0.1.0)
@spec lookup(String.t(), String.t(), Keyword.t()) ::
  {:ok, Actors.Registry.HostActor.t()} | {:not_found, []}

Fetch current entities of the service. Returns HostActor with Host and specific actor.

Link to this function

register(hosts)

View Source (since 0.1.0)
@spec register([Actors.Registry.HostActor.t()]) :: :ok

Register member entities to the ActorRegistry. Returns Cluster with all Host members.

examples

Examples

iex> hosts = [%HostActor{node: Node.self(), actor: actor, opts: []}}]
iex> ActorRegistry.register(hosts)
:ok
Link to this function

register_invocation_request(actor, request)

View Source

Registers a invocation request in CRDT Database Usually used for invocation schedulings

Link to this function

remove_invocation_request(actor, request)

View Source

Removes a invocation request in CRDT Database Usually used for invocation schedulings