The signal bus of the gateway process: vis.bus for extensions, and the signals
of Vis itself.
A signal has a topic, JSON data, a scope and a publish time. Each extension has
its own topics: a subscription of an extension gets only the signals of that
extension. A topic whose first word is vis is a signal of Vis. Only the gateway
publishes one, and only a pattern whose first word is vis gets it.
Scope global sends a signal to each matching subscription. Scope session
sends it only to the subscriptions of the session of the publisher. A
subscription with a scope gets only the signals of that scope, and a
subscription without a scope gets both. Each subscription has one agent, so it
gets its signals in publish order, and a slow subscriber never blocks a
publisher. Signals live only in memory: a subscription gets only the signals
that come after it. A subscriber in Python reads the data from the JSON text of
the publisher: see data-json. The bus_* definitions of gateway.json give
the bounds.
The signal bus of the gateway process: `vis.bus` for extensions, and the signals of Vis itself. A signal has a topic, JSON data, a scope and a publish time. Each extension has its own topics: a subscription of an extension gets only the signals of that extension. A topic whose first word is `vis` is a signal of Vis. Only the gateway publishes one, and only a pattern whose first word is `vis` gets it. Scope `global` sends a signal to each matching subscription. Scope `session` sends it only to the subscriptions of the session of the publisher. A subscription with a scope gets only the signals of that scope, and a subscription without a scope gets both. Each subscription has one agent, so it gets its signals in publish order, and a slow subscriber never blocks a publisher. Signals live only in memory: a subscription gets only the signals that come after it. A subscriber in Python reads the data from the JSON text of the publisher: see [[data-json]]. The `bus_*` definitions of `gateway.json` give the bounds.
(data-json signal)The data of signal as the JSON text of its publisher. A subscriber in Python
reads this text, so it gets the key order and the numbers of the publisher.
The data of `signal` as the JSON text of its publisher. A subscriber in Python reads this text, so it gets the key order and the numbers of the publisher.
(forget-context! context)End each subscription of extension namespace context, because its Python is gone.
End each subscription of extension namespace `context`, because its Python is gone.
(matches? pattern topic)True when subscription pattern pattern gets the signals of topic. * takes the
place of one word, and a last word # takes the place of zero or more words. A
topic with the first word vis needs a pattern with the first word vis. The SDK
gives the same answers: see vis-contract/fixtures/bus-patterns.json.
True when subscription pattern `pattern` gets the signals of `topic`. `*` takes the place of one word, and a last word `#` takes the place of zero or more words. A topic with the first word `vis` needs a pattern with the first word `vis`. The SDK gives the same answers: see `vis-contract/fixtures/bus-patterns.json`.
(open? id)True when subscription id is open.
True when subscription `id` is open.
(publish! topic-name data)(publish! publisher topic-name data scope)Give data, JSON data with string keys, under topic-name to each subscription
that gets it. Answer how many subscriptions get it. publisher is a map: :owner
is an extension name, or :vis for the gateway, and :session the session of the
publisher or nil. scope is "global" or "session". The two-argument form
publishes a global signal of Vis, which must be a bus_vis_signal of the contract.
Give `data`, JSON data with string keys, under `topic-name` to each subscription that gets it. Answer how many subscriptions get it. `publisher` is a map: `:owner` is an extension name, or :vis for the gateway, and `:session` the session of the publisher or nil. `scope` is "global" or "session". The two-argument form publishes a global signal of Vis, which must be a `bus_vis_signal` of the contract.
(publish-json! publisher topic-name data-json scope)publish! for data given as JSON text, such as the data of an extension. The
text must fit the size limit of the contract.
[[publish!]] for data given as JSON text, such as the data of an extension. The text must fit the size limit of the contract.
(subscribe! pattern deliver)(subscribe! {:keys [owner context session scope]} pattern deliver)Call deliver with each later signal of pattern that the subscriber gets.
subscriber is a map: :owner is an extension name, or :vis for the gateway.
:context is the extension namespace that owns the subscription, :session the
session of the subscriber or nil, and :scope is "global", "session" or nil
for both. The two-argument form subscribes the gateway. Answer the subscription
id.
Call `deliver` with each later signal of `pattern` that the subscriber gets. `subscriber` is a map: `:owner` is an extension name, or :vis for the gateway. `:context` is the extension namespace that owns the subscription, `:session` the session of the subscriber or nil, and `:scope` is "global", "session" or nil for both. The two-argument form subscribes the gateway. Answer the subscription id.
(unsubscribe! owner id)End subscription id of owner owner. A running delivery ends, and no other
starts. Answer true when the subscription was open.
End subscription `id` of owner `owner`. A running delivery ends, and no other starts. Answer true when the subscription was open.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |