View Source partisan_plumtree_broadcast_handler behaviour (partisan v5.0.0-rc.8)

This module defines a behaviour to customise the implementation for the operations performed by the partisan_plumtree_broadcast server.

Callbacks

The behaviour defines the following callbacks:
  • broadcast_data/1 - must return a two-tuple of message id and payload from a given broadcast. Where the broadcasted message is application-specific.
  • broadcast_channel/1 (optional) - Must return the channel to be used when broadcasting data associate with this handler. See partisan_plumtree_broadcast:broadcast/2.

Summary

Callbacks

Link to this callback

broadcast_channel/0

View Source (optional)
-callback broadcast_channel() -> partisan:channel().
-callback broadcast_data(any()) -> {any(), any()}.
-callback exchange(node()) -> {ok, pid()} | {error, term()} | ignore.
-callback graft(any()) -> stale | {ok, any()} | {error, any()}.
-callback is_stale(any()) -> boolean().
-callback merge(any(), any()) -> boolean().