RPC: Watch
Streams live notifications about a scope for the life of a connection, so new blobs reach followers without polling.
Fetching schema…

Part of Stem. This page defines the Watch method of the sync RPC specification. It is the publish-subscribe half of the sync protocol.

The formal schema is attached as the schemaDefinition of this page: a struct {key, input, output} with key pinned to Watch.

Subscribes the caller to live updates on a scope for the life of the connection. The server streams one notification per indexing commit that adds readable blobs to the scope set. This is the publish-subscribe path that lets comments arrive in seconds without polling.

Input

field

type

required

meaning

scope

data/scope

yes

The scope to watch.

since

timestamp

no

Send first anything indexed after this time.

Output

The output is rpc/type/notification.

Rules

    The server sends one notification per indexing commit that adds blobs to the watched scope set which the connection may read. Blobs the watcher may not read are never mentioned.

    If since is given, the first message carries every readable blob in the scope set indexed after that time, so a reconnecting watcher catches up without a reconciliation.

    A watch ends with the connection, with Goodbye, or when the server drops it under load (resource-exhausted on the stream). The watcher then reconciles once and watches again with since set to the last notification it saw.

    Watching confers no retention: the watcher fetches what it wants with Fetch, under its own policy.

    The server limits watches per connection and in total.

    A watch creates no durable state on the server.

Today (HM24)

HM24 has no live channel. A client polls Entities.DiscoverEntity roughly every twenty-six seconds to keep a hot task alive, and the daemon re-reconciles every ten seconds while the task is hot; the roadmap asks for a publish-subscribe pattern with three-second comment delivery. Watch is that pattern.

Example

{"key": "Watch", "input": {"scope": {"space": {"/": {"bytes": "7QEA…"}}, "node": "bafyrein6a6wfhym6l3vfz5zfkkibj5j6wjibagi3mnbqnspuq2idw52ijb", "depth": "subtree"}, "since": 1759910400000}}

Each message on the stream:

{"scope": {"space": {"/": {"bytes": "7QEA…"}}, "node": "bafyrein6a6wfhym6l3vfz5zfkkibj5j6wjibagi3mnbqnspuq2idw52ijb", "depth": "subtree"}, "cids": [{"/": "bafy…41"}], "ts": 1759910462000}

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime