Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

parsec subscribe

Tail a parsec channel from the terminal. Implemented as a Server-Sent Events (SSE) client against the server’s /sse?channel=<name> endpoint. Intended as a debug probe, not a production transport — production clients use the WebSocket (/connection/websocket) or WebTransport (/connection/webtransport) endpoints.

Usage

parsec subscribe <channel-name>

Each publication appears on stdout as one NDJSON envelope:

{"channel":"public:webapp.system.status","offset":42,"data":{"msg":"hello"}}

Ctrl-C exits cleanly.

Flags

FlagEnvDefault
--serverPARSEC_SERVERhttp://localhost:8000
--tokenPARSEC_TOKEN(empty)
--from-offset0 (latest)

For private channels, set --token to an access token (NOT a mgmt bearer):

parsec subscribe private:webapp.user.42.downloads \
  --token "$(parsec channels create private:webapp.user.42.downloads --subject u42 | jq -r .payload.access_token)"

Why not for production?

SSE polls. The server holds a long-lived HTTP connection but the backpressure model and reconnection semantics are simpler than the WebSocket transport — fine for a debug probe, suboptimal for browser clients. Use centrifuge-js (or the parsec library directly inside a Go service) for real workloads.