| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mycelium holds its node's lock for as long as a request for the inbox
waits for a message, and every other request waits for that lock, the
messages we send among them: with two polls of up to five minutes, a
node with nothing coming in sent nothing until a message came in (each
send timing out after ten seconds), so two idle nodes never reached each
other, a node joining a federation whose only node was its founder's
among them.
The inbox is waited for by one request, and only while nothing else is
asked of the daemon: a send, or a seed's lookup, takes a turn (`Turn`),
which drops the waiting request, freeing the daemon's lock as its API
drops a request whose client went away. While turns are under way, the
poller takes what is there without waiting, again as each begins or
ends; then it waits again. It waits peeking, the message left in the
inbox, and pops it after without waiting, so a request dropped while it
waited takes nothing with it. Nothing is asked of the daemon again and
again: an idle node has one request waiting there, for up to five
minutes.
The warnings about the daemon's API name the error's causes, not only
which request failed.
|