place.hud.index.subscribe
A spec's collection and conditions, live: an open stream of server-sent events (text/event-stream) from HUD's index (`hud index`), one whenever a record that could match the spec is written or deleted, by its live stream or a backfill, at most one every 250 milliseconds. No record is sent: read the spec's answer again (place.hud.index.query). Its collection is taken in as a query's would be. Of its conditions, eq and in on a record's values and by as a list of DIDs pick the records heard of; the rest hear of every record of the collection. Each event's data is one JSON object, typed by its $type: #changedEvent. A comment, ping, comes every 25 seconds when nothing else does. It is a query, not an XRPC subscription, as HUD's own event streams are: it keeps no history to backfill from, and what changed while no stream was open is read again. Each address holds a bounded number of streams, and the index a bounded number in all. No auth required.
Details · query
| Kind | query |
|---|---|
| Authority | index.hud.place |
| Commit rev | 3n3m2ruqenzju |
| Indexed |
Checks
Valid Lint pass{
"$type": "com.atproto.lexicon.schema",
"defs": {
"changedEvent": {
"description": "A record that could match the spec was written or deleted: read its answer again.",
"properties": {
"version": {
"description": "A mark of what the spec's answer reads, as it stood once the write was in: as place.hud.index.query's version of a complete answer. Opaque.",
"maxLength": 128,
"type": "string"
}
},
"required": [
"version"
],
"type": "object"
},
"main": {
"description": "A spec's collection and conditions, live: an open stream of server-sent events (text/event-stream) from HUD's index (`hud index`), one whenever a record that could match the spec is written or deleted, by its live stream or a backfill, at most one every 250 milliseconds. No record is sent: read the spec's answer again (place.hud.index.query). Its collection is taken in as a query's would be. Of its conditions, eq and in on a record's values and by as a list of DIDs pick the records heard of; the rest hear of every record of the collection. Each event's data is one JSON object, typed by its $type: #changedEvent. A comment, ping, comes every 25 seconds when nothing else does. It is a query, not an XRPC subscription, as HUD's own event streams are: it keeps no history to backfill from, and what changed while no stream was open is read again. Each address holds a bounded number of streams, and the index a bounded number in all. No auth required.",
"errors": [
{
"description": "The spec is malformed: the message says how.",
"name": "InvalidSpec"
},
{
"description": "This address, or the index in all, holds as many streams as it may: hear by asking place.hud.index.query again in a while.",
"name": "LimitReached"
}
],
"output": {
"encoding": "text/event-stream"
},
"parameters": {
"properties": {
"spec": {
"description": "The spec, as JSON, as place.hud.index.query takes it: its collection, by and where are heard; the rest is read and checked, and changes nothing.",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"spec"
],
"type": "params"
},
"type": "query"
}
},
"description": "Word of the writes a spec's answer may change by, from HUD's index, as server-sent events.",
"id": "place.hud.index.subscribe",
"lexicon": 1
}