Concepts

Daemon

Aka Master. The Daemon is the center of communications as all Peers connect to it. When Peers communicate with each other, the Daemon handles the message routing. All the heavy-lifting like filtering and sorting happens inside the daemon. Most likely the Daemon runs on the same machine as your webserver, but just could run anywhere else!

The Daemon itself does not provide any content at all, but provides means for content registration. Technically the inner wirings maybe described as a publish-subscribe engine with built-in content cache.

Peer

Aka Client. Peers can provide and/or consume content. They have to connect to a Daemon to be part of the Jet bus. To provide content Peers can register States and/or Methods. Consuming content means either fetching, calling or setting States/Methods.

Peers can run on the same machine as the Daemon or on remote machines, possibly within Browsers. A common usage scenario is that the Peers running on the same machine as the Daemon provide content (as the Todo-Server) and other Peers consume this content from a Browser (as the Todo-Client).

State

Aka Document. A logical piece of information (value), identified by a unique name (path). A State's value can be of any Javascript type: primitive types, nested Objects or Arrays. Peers can add States to the Jet Bus by registrating them to the Daemon. States may change its value spontaneously or on behalf of another Peer. They are subject to fetching and thus are observable by other Peers.

States may represent things like user records, CPU temperature or network settings. The Peer adding the State defines the behaviour when a set request comes in and is free to do anything that is appropriate. If necessary the requested value maybe adapted, interpolated or refused.

Method

Aka Service. An action identified by a unique name (path) which can be executed by other Peers. Methods can have any number and any type of parameters. Peers can add Methods to the Jet Bus by registrating them to the Daemon. Unlike States, Methods have no associated value. Methods are subject to fetching and thus are observable by other Peers.

A method may do just anything. It could light an LED, create States (e.g. "todo/add") or perform a system update. However, it should not behave like classical "getter/setter" as States are intended for this purpose.

Fetching

Aka Query. Fetching is the process of continuously gathering information. Peers can fetch to obtain content from a Daemon, which in turn is provided by Peers. This is much like a database query as you can exactly define what content you want based on name (path) and/or values of States and Methods. The Jet Daemon can also sort and paginate your data based on State values.

The best thing is, that the content gets updated as soon as something relevant concerning your fetch rule changes: new content gets added or removed, values changed.

Imagine a score board, which should display the female top ten players ordered by their score, which gets updated automatically as players score. With Jet this is piece of cake!