Metadata-Version: 2.4
Name: firm-channel
Version: 0.1.0
Summary: Database-backed publish/subscribe (a pure-Python port of Rails' Solid Cable). No Redis required — runs on SQLite, PostgreSQL, or MySQL.
Keywords: channel,pubsub,sqlite,postgresql,mysql,solid_cable
Author: firm contributors
License-Expression: MIT
License-File: LICENSE
License-File: NOTICE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Database
Classifier: Typing :: Typed
Requires-Dist: firm-core~=0.1.0
Requires-Dist: click>=8.1
Requires-Dist: firm-core[mysql] ; extra == 'mysql'
Requires-Dist: firm-core[postgres] ; extra == 'postgres'
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/h11t-labs/firm
Project-URL: Repository, https://github.com/h11t-labs/firm
Project-URL: Issues, https://github.com/h11t-labs/firm/issues
Provides-Extra: mysql
Provides-Extra: postgres
Description-Content-Type: text/markdown

# firm-channel

Database-backed publish/subscribe for Python — a pure-Python port of Rails'
[Solid Cable](https://github.com/rails/solid_cable). No Redis required: messages flow through
your existing **SQLite**, **PostgreSQL**, or **MySQL/MariaDB** database.

Part of [firm](https://github.com/h11t-labs/firm), a port of the Rails 8 Solid stack.

```bash
pip install firm-channel
```

## Quickstart

```python
from firm.channel import Channel

ps = Channel(database_url="postgresql://localhost/myapp")

ps.subscribe("room:42", lambda payload: print(payload))
ps.broadcast("room:42", b'{"msg": "hi"}')
```

## Highlights

- **Broadcast/subscribe** over the database — no extra broker to run
- **Polling listener** with configurable interval, in the style of Solid Cable
- **Automatic message trimming** with configurable retention

## Docs

- [Channel overview](https://github.com/h11t-labs/firm/blob/main/docs/channel/overview.md)
- [All firm documentation](https://github.com/h11t-labs/firm#readme)

MIT licensed. Schema and design derived from Solid Cable (© 37signals, MIT); see
[NOTICE](https://github.com/h11t-labs/firm/blob/main/NOTICE).
