Slave rows, read once per connection and then kept current from each transaction's delta.
Reading every slave entity is the expensive part of a roster query: the swarm keeps every row it ever saw, so a full read materializes thousands of entities to return the handful that are live. This index pays that cost once, then re-reads only the slave entities a transaction touched.
Consumers that want to react instead of poll subscribe! and are called
after any transaction that changed a slave row.
Slave rows, read once per connection and then kept current from each transaction's delta. Reading every slave entity is the expensive part of a roster query: the swarm keeps every row it ever saw, so a full read materializes thousands of entities to return the handful that are live. This index pays that cost once, then re-reads only the slave entities a transaction touched. Consumers that want to react instead of poll `subscribe!` and are called after any transaction that changed a slave row.
(apply-delta by-eid touched db-after)BY-EID advanced by one transaction: only the TOUCHED slave entities are re-read from DB-AFTER.
BY-EID advanced by one transaction: only the TOUCHED slave entities are re-read from DB-AFTER.
(scan db){eid slave-map} for every slave row in DB. The full read.
{eid slave-map} for every slave row in DB. The full read.
(slaves c db){eid slave-map} for conn C, whose current value is DB. Served from the index when it is current; rebuilt, with its listener installed on C, when it is not.
{eid slave-map} for conn C, whose current value is DB. Served from the
index when it is current; rebuilt, with its listener installed on C,
when it is not.(subscribe! key f)Call F (no args) after every transaction that changes a slave row. Re-subscribing under KEY replaces the previous F. Returns KEY.
Call F (no args) after every transaction that changes a slave row. Re-subscribing under KEY replaces the previous F. Returns KEY.
(touched-eids tx-data)Entity ids whose slave attributes TX-DATA changed.
Entity ids whose slave attributes TX-DATA changed.
(unsubscribe! key)Stop calling the subscriber under KEY.
Stop calling the subscriber under KEY.
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 |