macula_rpc_server (macula v0.14.3)
View SourceRPC server managing registrations and calls. GenServer that integrates registry, cache, discovery, router, and executor.
Summary
Functions
Synchronous call to procedure.
Handle synchronous calls.
Handle asynchronous casts (none implemented).
Handle info messages (none expected).
Initialize server state.
List local registrations.
Register procedure.
Start RPC server.
Stop RPC server.
Cleanup on termination.
Unregister procedure.
Types
-type config() :: #{routing_strategy => macula_rpc_router:strategy(), cache_enabled => boolean(), dht_lookup_fun => macula_rpc_dht:dht_lookup_fun(), send_fun => macula_rpc_executor:send_fun()}.
-type state() :: #{local_node_id := binary(), registry := macula_rpc_registry:registry(), cache := macula_rpc_cache:cache(), router_state := macula_rpc_router:router_state(), config := config()}.
Functions
Synchronous call to procedure.
Handle synchronous calls.
Handle asynchronous casts (none implemented).
Handle info messages (none expected).
Initialize server state.
-spec list_registrations(pid()) -> [macula_rpc_registry:registration()].
List local registrations.
-spec register(pid(), binary(), macula_rpc_registry:handler_fn(), map()) -> ok.
Register procedure.
Start RPC server.
-spec stop(pid()) -> ok.
Stop RPC server.
Cleanup on termination.
-spec unregister(pid(), binary(), macula_rpc_registry:handler_fn()) -> ok.
Unregister procedure.