mem_macula_mesh (macula_testkit v0.1.0)

View Source

The shared in-memory fabric behind a mem_macula cluster.

Holds every subscription across all pools in the cluster and fans a publish out to the matching subscribers, reproducing the macula pub/sub contract: subscribers receive {macula_event, SubRef, Topic, Payload, Meta}. A publish on one pool reaches subscribers registered through any pool, which is what gives the cluster mesh-broadcast semantics with no QUIC and no station.

Summary

Functions

add_sub(Mesh, Realm, Topic, Pid)

-spec add_sub(pid(), binary(), binary(), pid()) -> {ok, reference()}.

deliver(Mesh, Realm, Topic, Payload)

-spec deliver(pid(), binary(), binary(), term()) -> ok.

handle_call(Req, From, S)

handle_cast(Msg, S)

handle_info(Info, S)

init(_)

remove_sub(Mesh, Ref)

-spec remove_sub(pid(), reference()) -> ok.

start_link()

stop(Mesh)

terminate(Reason, S)