WorkerCluster
A distributed solver on the threads of Node.js (worker_threads): the catalog on the calling thread, the workers on threads threads, each loading this module (module, this very file by default) and running a site of its own, a delegate of the one of the calling thread (see Site.delegate), over the messages between threads: the cluster lends the workers of its threads to the sites it is federated with. The theory is split into at most parts partitions if given, as many as the workers of the threads and of the sites it is federated with otherwise (see listen and connect); the graph is labelled as the standard solver does with flags. The threads keep Node.js running only while an evaluation is pending; close stops them.
Properties
The sites heard on the local network, not linked to this cluster (see discover)
Called whenever the sites heard on the local network change
Called whenever a site joins or leaves the peers of the cluster, its threads included
Whether the sites linking to this cluster must present its code, or the token of a pairing made with it: refused otherwise, and after a few wrong codes from an address its codes are refused for a while
The cluster as a solver of arg2p: any goal, its solutions and their graphs, the answers of queries
What the federation does, as the cluster knows it: the sites, and the last evaluation it answered (see Site.stats)
Functions
Federates the cluster with the clusters of the local network that discover the others as well, as they come (see Beacons): it listens (on an ephemeral port, if it did not already), and its beacons go to beaconPort. With requireCode (see requiresCode), the clusters heard are nearby alone, linked to once paired by hand (pair), and linked again with no code from then on. The port it listens on, once its beacons start.