SwimEx. Transport behaviour
(SwimEx v0.1.0)
View Source
Behaviour for SWIM transport implementations.
Implementations must deliver received packets to the registered
receiver as {:swim_packet, from :: {String.t(), port}, binary}.
Summary
Callbacks
Close the transport.
Send a binary payload to the given node.
Register the process that will receive incoming packets.
Start the transport, binding to the given port.
Functions
Strips the cookie from a 3-element identity tuple, returning a 2-element transport address.
Types
@type node_id() :: {String.t(), :inet.port_number()}
@type server() :: GenServer.server()
Callbacks
@callback close(server()) :: :ok
Close the transport.
Send a binary payload to the given node.
Register the process that will receive incoming packets.
@callback start_link(keyword()) :: GenServer.on_start()
Start the transport, binding to the given port.
Functions
@spec strip_cookie({String.t(), :inet.port_number(), String.t()} | node_id()) :: node_id()
Strips the cookie from a 3-element identity tuple, returning a 2-element transport address.