Routing

class p2p0mq.router.Router(*args, **kwargs)[source]

Manages the routing.

default_route

The id of the peer to which messages that cannot be routed are sent.

process_routes(queue)[source]

Processing the routing requests during the local peer loop.

The messages that need routing are detected by the server (Receiver) and placed in a distinct queue. The local peer then calls this method to process the messages.

class p2p0mq.concerns.ask_around.AskAroundConcern(*args, **kwargs)[source]

Routing helper that asks connected peers about ways to reach a certain peer.

compose_ask_around_message(peer, exclude, breadcrumbs=None)[source]

Creates a message asking about a peer’s whereabouts.

Parameters:
  • peer (Peer) – The peer we’re interested in
  • exclude – The list of peers we should not ask about it.
  • breadcrumbs – The path the message took to reach us.
process_reply(message)[source]

Handler on the sender side for ask around reply.

process_request(message)[source]

Handler on the receiver side for ask around requests.