macula_local_client (macula v0.20.5)
View SourceLocal client for in-VM workloads to connect to macula_gateway
This module provides process-to-process communication between workloads running in the same BEAM VM as the Macula platform and the local gateway. Unlike macula_peer which creates QUIC connections, this connects directly to the local macula_gateway process.
Architecture: Phoenix/Elixir App → macula_local_client → macula_gateway ↓ (QUIC) Other Peers
Summary
Functions
Advertise an RPC service with default options
Advertise an RPC service with options
Call an RPC procedure with default options
Call an RPC procedure
Connect to remote gateway (not supported for local client) For compatibility with macula_client_behaviour
Create a local client connection to the gateway
Disconnect the client
Discover subscribers of a topic via DHT query
Get the current Platform Layer leader node ID
Get the node ID of the local gateway
Handle pubsub events from gateway Gateway sends messages in format: {publish, Topic, Payload}
Propose a CRDT update with default options (LWW-Register)
Propose a CRDT update with specific type
Publish an event to a topic
Publish an event to a topic with options
Read the current value of a CRDT-managed state entry
Register an RPC procedure (legacy API, use advertise/3 instead)
Register this workload with the Platform Layer
Start a local client connection to the gateway (legacy API)
Stop the local client (legacy API)
Subscribe to a topic
Subscribe to Platform Layer leader change notifications
Unadvertise an RPC service
Unregister an RPC procedure (legacy API, use unadvertise/2 instead)
Unsubscribe from a topic
Functions
Advertise an RPC service with default options
Advertise an RPC service with options
Call an RPC procedure with default options
Call an RPC procedure
Connect to remote gateway (not supported for local client) For compatibility with macula_client_behaviour
Create a local client connection to the gateway
-spec disconnect(pid()) -> ok.
Disconnect the client
Discover subscribers of a topic via DHT query
Get the current Platform Layer leader node ID
Get the node ID of the local gateway
Handle pubsub events from gateway Gateway sends messages in format: {publish, Topic, Payload}
Propose a CRDT update with default options (LWW-Register)
Propose a CRDT update with specific type
Publish an event to a topic
Publish an event to a topic with options
Read the current value of a CRDT-managed state entry
Register an RPC procedure (legacy API, use advertise/3 instead)
Register this workload with the Platform Layer
Start a local client connection to the gateway (legacy API)
-spec stop(pid()) -> ok.
Stop the local client (legacy API)
Subscribe to a topic
Subscribe to Platform Layer leader change notifications
Unadvertise an RPC service
Unregister an RPC procedure (legacy API, use unadvertise/2 instead)
Unsubscribe from a topic