Metadata-Version: 2.4
Name: esa-livefeed
Version: 0.0.1
Summary: Low-latency live feed server and managed client over raw TCP with JSONL framing, heartbeats, liveness detection, and unbounded per-client backpressure.
Author-email: Ely-Sandra <info@ely-sandra.com>
License-Expression: MIT
Project-URL: Documentation, https://esa-livefeed.readthedocs.io/
Project-URL: Homepage, https://github.com/ely-sandra/esa-livefeed
Project-URL: Repository, https://github.com/ely-sandra/esa-livefeed.git
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: hanaro>=2.0.1
Dynamic: license-file

# esa-livefeed

Low-latency live feed server and managed client over raw TCP with JSONL framing,
client-driven heartbeats, bidirectional liveness detection, and unbounded
per-client backpressure. Pure Python stdlib; zero runtime dependencies.

- `LivefeedServer` / `LivefeedServerSettings` — accepts clients (one
  `LivefeedSession` per client: dedicated sender/receiver threads and an
  unbounded outbound queue), fans out pre-encoded frames via
  `publish(data: bytes)`, exposes connected clients via the `clients`
  property, delivers client data frames to a registered message callback
  (with the originating session for targeted replies), drops clients only
  on liveness loss, and logs delivery-delay warnings without ever dropping
  data.
- `LivefeedClient` / `LivefeedClientSettings` — managed bidirectional
  client: `start()` spawns background threads that connect, handshake,
  deliver data frames to a registered message callback, send messages via
  `send_message(dict)`, heartbeat after 3s of inactivity, detect a dead
  server, and auto-reconnect into fresh state (no backlog).
- Callbacks are registered on the objects themselves via
  `set_message_callback` / `set_connect_callback` / `set_disconnect_callback`
  (settings carry no callables), and every callback receives the peer
  object first so handlers can communicate back.

Wire protocol: newline-delimited JSON. Control frames: `hello`, `auth`,
`heartbeat` (client only), `ack`, `ping`, `pong`. Data frames are
application-defined (e.g. `{"type":"data",...}`).

## Building

```bash
uv build          # or: pip wheel .
```

## Tests

```bash
python -m punit
```
