Package-level declarations

Types

Link copied to clipboard
class Beacons(site: Site, port: Int, interval: Long, connect: (url: String, code: String?, done: () -> Unit) -> Unit)

The discovery of the sites of a local network, whatever the way their beacons travel (UDP multicast on the JVM and on Node.js): each discovering site announces itself, every interval milliseconds, with its name, the port of its WebSocket server (port) and whether it requires a code (see Site.requiresCode); the sites it hears, of its version, are its nearby ones (see Site.nearby), until they are heard no more.

Link copied to clipboard
data class EvaluationStats(val locality: String, val arguments: Int, val attacks: Int, val added: Int, val workers: List<WorkerStats>, val milliseconds: Double)

An evaluation answered by the catalog of a site (a statement evaluated, or a goal labelling or reading a graph): the part of the graph it was answered on (locality: directional or connected in query mode, whole_graph otherwise, or catalog for a graph the catalog builds alone, as an abstract framework, with no worker), the arguments and the attacks of the graph labelled (those the catalog derives from the others included), the arguments the workers built for it (added: all of them for a graph built anew, those explored further in query mode, none for an evaluation answered on the graph as it was), what each worker of the graph built (workers, one for each partition of the theory), and how long the evaluation took, in milliseconds (the construction of the graph included)

Link copied to clipboard
data class FederationStats(val site: String, val sites: List<SiteStats>, val evaluation: EvaluationStats?, val nearby: List<NearbySite> = emptyList())

What a federation does, as one of its sites (site) knows it: the sites it knows, itself first, the last evaluation it answered (evaluation, none before the first), and the sites heard on the local network that are not its peers (nearby, see Beacons)

Link copied to clipboard
class LanDiscovery(site: Site, links: WebSocketLinks, wsPort: Int, beaconPort: Int = Beacons.PORT, group: String = Beacons.GROUP, interval: Int)

The sites of the local network found and linked to site (see Beacons), on Node.js: its beacons sent over UDP multicast, to group on beaconPort, every interval milliseconds, with the port of the WebSocket server of links, wsPort. Neither the beacons nor their socket keep Node.js running.

class LanDiscovery(site: Site, links: WebSocketLinks, wsPort: Int, beaconPort: Int = Beacons.PORT, group: String = Beacons.GROUP, interval: Long) : AutoCloseable

The sites of the local network found and linked to site (see Beacons): its beacons sent over UDP multicast, to group on beaconPort, every interval milliseconds, with the port of the WebSocket server of links, wsPort. The group is joined, and the beacons sent, on every interface able to (the loopback one as well, for the sites of the same machine), over IPv4 alone: a socket of both IPv4 and IPv6 may not reach an IPv4 group (on macOS).

Link copied to clipboard
interface Link

A connection between two sites, over any transport (memory, the threads of a process, a socket): the frames sent on it arrive in the order they were sent, until it is closed

Link copied to clipboard
interface LinkListener

A site, as the transports see it: told of its links as they open, of the frames on them and of their closing

Link copied to clipboard

Links between sites of the same process, for tests and for sites sharing a machine without a network between them

Link copied to clipboard
data class NearbySite(val id: String, val name: String, val address: String, val requiresCode: Boolean)

A site heard on the local network (see Beacons): its identifier, its name (the name of its host, or the one it was given), its address (ws://host:port) and whether it requires a code of the sites linking to it (requiresCode: it waits to be paired)

Link copied to clipboard

The queues run on a pool of threads daemon threads, each queue on one thread at a time: a task that fails is skipped, as an actor resumed on a failure does

Link copied to clipboard
class RtcLinks(site: Site, iceServers: Array<dynamic> = emptyArray())

The links of site over WebRTC data channels, in browsers: to every site opening such links it is introduced to (see Site.onIntroduced), what the two need to connect sent through the sites linked to both (see Site.signal). Of two sites, the one with the lower identifier offers the link. iceServers are those of RTCPeerConnection (none by default: the sites of a local network reach each other without them).

Link copied to clipboard
fun interface Scheduler

Where the nodes of a site run: each node has a queue of its own, and the queues may run in parallel

Link copied to clipboard

Every task on the thread that posts it, in the order they were posted, those of all queues together: a task posted while another runs waits for it, so that the nodes run in turn, in a deterministic order. A task that fails leaves those after it queued, for the next post.

Link copied to clipboard
class Site(scheduler: Scheduler, workers: Int?, parts: Int? = null, flags: Flags = Flags.defaults(), lends: Boolean = true, textual: Boolean = false, introducible: Boolean = false, val id: String = newId()) : LinkListener

An instance of the distributed solver, on any platform: a catalog for a theory of its own, the workers it runs on scheduler (at most workers for a graph, null for no limit), and its peers, other sites on the links its transports give it (see Link), on this machine or another, whatever their platform.

Link copied to clipboard
data class SiteStats(val id: String, val workers: Int?, val delegate: Boolean, val via: String?)

A site of a federation: its identifier, the workers it offers (its delegates' included, for the site knowing it as for the others; null for no limit, or for a site reached through another, whose workers are not known), whether it is a delegate of the site knowing it (a thread or a Web Worker of it, listed as well, with its own workers: the workers of a federation are those of the sites that are not delegates), and the site through which it is reached (via: null for the site itself and those linked to it)

Link copied to clipboard
class StaticContent(val content: ByteArray, val contentType: String)

A page served over plain HTTP: its content, of the media type contentType (as text/html; charset=utf-8)

Link copied to clipboard
fun interface TaskQueue

Tasks run one at a time, in the order they were posted

Link copied to clipboard

The links of site over WebSockets, to sites on any platform (JVM, Node.js, browsers): the links it accepts once it listens (on Node.js, through the package ws), and those it opens (connect, with the WebSocket of the runtime). Each frame is a text message; those of a link arrive in order.

The links of site over WebSockets, to sites on any platform (JVM, Node.js, browsers): the links it accepts once it listens, and those it opens (connect). Each frame is a text message; those of a link arrive in order. The port listened on answers the plain HTTP requests for the pages it serves as well.

Link copied to clipboard
data class WorkerStats(val partition: Int, val site: String, val arguments: Int, val attacks: Int)

A worker of a graph: its partition of the theory, the site that ran it (as the site of the catalog placed it: a site lending the workers of its delegates runs them on those), the arguments of its rules it built and the direct attacks on them it found