Configuration¶
The node¶
Everything is an argument of Node; the class
description has the details of each.
Argument |
Default |
Meaning |
|---|---|---|
|
|
|
|
The shared secret; the same on all nodes. |
|
|
|
A hidden node is listed by |
|
|
Seconds, as the kernel parameter of that name in Erlang: an idle connection is ticked every quarter of it, and a silent node is given up after it. Use the value of the Erlang nodes. |
|
|
|
|
|
The port other nodes connect to; 0 picks a free one. |
|
host name |
For a dynamic node name: the host part the name gets. |
|
256 MiB |
A peer whose unfinished fragmented messages exceed this is disconnected. |
|
1 MiB |
When more than this waits to be sent to a node, |
|
10 000, 32 MiB |
When this much of what a node sent waits in process inboxes, reading from that node pauses, which suspends its senders. |
The EPMD port is taken from the environment variable ERL_EPMD_PORT, as
Erlang does; the default is 4369.
Without EPMD¶
node = Node("py@127.0.0.1", "COOKIE", epmd=False, dist_port=4370)
await node.wait_started()
await node.connect("erl@127.0.0.1", "127.0.0.1", 4371)
An Erlang node started with
erl -name erl@127.0.0.1 -start_epmd false -erl_epmd_port 4371 listens on
that port. This fragment is not run by the tests as it
stands; test/test_epmd_client.py::test_connect_without_epmd does the same
with free ports.
Logging¶
Pyrlang logs through the standard logging module under the logger
pyrlang and configures nothing when it is imported. An application sets
up logging itself, or calls pyrlang.util.start_pyrlang(), which
reads two environment variables:
PYRLANG_LOG_LEVEL:CRITICAL,ERROR,WARNING,INFO,DEBUGorNOTSET; the level of the loggerpyrlang.PYRLANG_ENABLE_LOG_FORMAT:1,yes,trueoroninstalls a format with time, logger, module and line.
Cookies, challenges and digests are never logged.
Errors¶
Every exception Pyrlang raises derives from
pyrlang.errors.PyrlangException. Bytes from the network are
untrusted: a malformed packet is logged and closes that one connection,
with the effect of a lost connection on links and monitors; it does not
raise into your code.