Metadata-Version: 2.4
Name: xyberos-queues
Version: 0.1.0
Summary: Message queue plugin (RFC-0019, M9): Redis Streams, RabbitMQ, Kafka behind one MessageQueue contract
License: Apache-2.0
Keywords: xyberos,plugin,queue,redis,rabbitmq,kafka
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: xyberos>=1.0
Provides-Extra: redis
Requires-Dist: redis; extra == "redis"
Provides-Extra: rabbitmq
Requires-Dist: pika; extra == "rabbitmq"
Provides-Extra: kafka
Requires-Dist: kafka-python; extra == "kafka"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: fakeredis; extra == "test"

# xyberos-queues

**Message queue plugin — RFC-0019, M9.** Redis Streams, RabbitMQ, and Kafka
behind one `MessageQueue` contract (`publish` / `poll`).

## Install

```bash
pip install -e ./queues
pip install xyberos-queues[redis]      # optional drivers
pip install xyberos-queues[rabbitmq]
pip install xyberos-queues[kafka]
```

## Usage

```python
from xyberos import create_app
from xyberos_queues import QueuesPlugin

app = create_app()
app.load_plugin(QueuesPlugin(provider="redis"))     # or QUEUE_PROVIDER

app.tools.execute("queue_publish", None, topic="jobs", message="do work")
app.tools.execute("queue_poll", None, topic="jobs")     # -> "do work"
```

| Provider | Config |
| -------- | ------ |
| `redis` | Redis Streams (URL via `REDIS_URL`) |
| `rabbitmq` | host/port (default `localhost:5672`) |
| `kafka` | `bootstrap_servers` (default `localhost:9092`) |

`poll` drains one message (oldest first) per call; returns `None` when empty.

## Tests

```bash
pip install pytest fakeredis
pytest tests/
```

fakeredis + fake clients — no live brokers.

## Ship location

Plugin (`xyberos.plugins` entry point) — infrastructure queues (M9).
