Overview & Philosophy
Applied to an element via data-ln-websocket-connector inside a ln-data-coordinator tree, this component opens a WebSocket connection, turns server pushes into ln-websocket-connector:fetched, and answers the same request events as ln-api-connector and ln-couchdb-connector. Connection status is private state announced by events (:connecting, :connected, :disconnected) — never mirrored as a DOM attribute.
As a zero-dependency push transport, it can run beside a REST connector to deliver live backend changes into local stores, or run standalone to carry reads, writes, and real-time pushes over a single duplex socket.
Both examples below talk to one local mock. Start it, then reload this page:
php demo/websocket/ws-mock.php
It listens on port 8090, changes a random task every few seconds, and pushes every write to every open socket — a task added in one example appears in the other.
1. REST reads and writes, socket pushes
| # | Task | Status | Priority | Assignee |
|---|
No tasks yet — is the mock running?
2. Socket alone — reads, writes and pushes
| # | Task | Status | Priority | Assignee |
|---|
No tasks yet — is the mock running?