View Source partisan_plumtree_backend (partisan v5.0.0-rc.8)
This modules implements a server that realises the partisan_plumtree_broadcast_handler
behaviour in order to diseminate heartbeat messages. Partisan uses these heartbeat messages to stimulate the Epidemic Broadcast Tree construction.
hearbeat` message periodically using the `broadcast_heartbeat_interval` option. Notice that this handler does not perform AAE Exchanges, as we will always have a periodic heartbeat. For that reason, the implementation of the <a docgen-rel="seemfa" docgen-href="partisan_plumtree_broadcast_handler#exchange/1" href="partisan_plumtree_broadcast_handler.html#exchange-1"><code>partisan_plumtree_broadcast_handler:exchange/1</code></a> callback always returns `ignore
.
Summary
Functions
Returns the channel to be used when broadcasting a message on behalf of this handler.
Returns from the broadcast message the identifier and the payload. In this case a tuple where both arguments have the broadcast message
timestamp
. These messages are used by Partisan as a stimulus for the Epidemic Broadcast Tree (Plumtree) construction.Returns
ignore`. This is because we don
t need to worry about reliable delivery: we always know we'll have another heartbeat message to further repair during the next interval.Given a message identifier and a clock, return a given message.
Use the clock on the object to determine if this message is stale or not.
Perform a merge of an incoming object with an object in the local datastore.
Same as start_link([]).
Start and link to calling process.
Types
Functions
-spec broadcast_channel() -> partisan:channel().
-spec broadcast_data(broadcast_message()) -> {broadcast_id(), broadcast_payload()}.
timestamp
. These messages are used by Partisan as a stimulus for the Epidemic Broadcast Tree (Plumtree) construction.
-spec exchange(node()) -> {ok, pid()} | {error, any()} | ignore.
ignore`. This is because we don
t need to worry about reliable delivery: we always know we'll have another heartbeat message to further repair during the next interval.
-spec graft(broadcast_id()) -> stale | {ok, broadcast_payload()} | {error, term()}.
-spec init([]) -> {ok, state()}.
-spec is_stale(broadcast_id()) -> boolean().
-spec merge(broadcast_id(), broadcast_payload()) -> boolean().
-spec start_link() -> {ok, pid()} | ignore | {error, term()}.
-spec start_link(list()) -> {ok, pid()} | ignore | {error, term()}.
-spec terminate(term(), state()) -> term().