dist.distribution module

Distribution class is not a separate running Greenlet, but rather a helper, which is called upon.

class pyrlang.dist.distribution.ErlangDistribution(node_name: str, engine: pyrlang.async_support.base_engine.BaseEngine)

Bases: object

Implements network part of the EPMD registration and Erlang distribution protocol. Extends functionality of Node, so all functions take Node as a parameter but don't store it to avoid creating a ref cycle.

connect() → bool

Looks up EPMD daemon and connects to it trying to discover other Erlang nodes.

connect_to_node(local_node: str, remote_node: str, engine: pyrlang.async_support.base_engine.BaseEngine)

Query EPMD where is the node, and initiate dist connection. Blocks the Greenlet until the connection is made or have failed.

Parameters:
  • engine -- Async engine adapter (GeventEngine or AsyncioEngine)
  • local_node -- Reference to Erlang Node object
  • remote_node -- String with node 'name@ip'
Returns:

Handler or None

creation_ = None

Creation id used in pid generation. EPMD gives creation id to newly connected nodes.

destroy()
disconnect() → None

Finish EPMD connection, this will remove the node from the list of available nodes on EPMD

engine_ = None

Async adapter engine for network and timer operations implemented either as Gevent or asyncio

node_name_ = None

Node name, a string.