mem_macula (macula_testkit v0.1.0)

View Source

In-memory macula loopback: stand up an N-node mesh whose pools are drop-in replacements for real macula pools.

{ok, #{pools := [A, B]}} = mem_macula:cluster(2), {ok, _} = macula:subscribe(B, Realm, Topic, self()), ok = macula:publish(A, Realm, Topic, Fact), %% self() receives {macula_event, _, Topic, Fact, _}

No QUIC, no station, no certificates.

Summary

Functions

A mesh plus N pools bound to it. Returns the mesh and the pools.

A fresh pool bound to an existing mesh.

Functions

cluster(N)

-spec cluster(pos_integer()) -> {ok, #{mesh := pid(), pools := [pid()]}}.

A mesh plus N pools bound to it. Returns the mesh and the pools.

pool(Mesh)

-spec pool(pid()) -> {ok, pid()}.

A fresh pool bound to an existing mesh.

start_mesh()

-spec start_mesh() -> {ok, pid()}.

stop(_)

-spec stop(#{mesh := pid(), pools := [pid()]}) -> ok.