Metadata-Version: 2.1
Name: litestar-saq
Version: 0.1.1
Summary: Litestar integration for SAQ
Project-URL: Changelog, https://cofin.github.io/litesatr-saq/latest/changelog
Project-URL: Discord, https://discord.gg/X3FJqy8d2j
Project-URL: Documentation, https://cofin.github.io/litesatr-saq/latest/
Project-URL: Homepage, https://cofin.github.io/litesatr-saq/latest/
Project-URL: Issue, https://github.com/cofin/litestar-saq/issues/
Project-URL: Source, https://github.com/cofin/litestar-saq
Author-email: Cody Fincher <cody.fincher@gmail.com>
License: MIT
License-File: LICENSE
Keywords: litestar,saq
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development
Classifier: Typing :: Typed
Requires-Python: >=3.8
Requires-Dist: litestar[cli,redis]>=2.0.1
Requires-Dist: saq[hiredis]>=0.12.0
Description-Content-Type: text/markdown

# Litestar SAQ

> [!IMPORTANT]
> This plugin currently contains minimal features and is a work-in-progress

## Installation

```shell
pip install litestar-saq
```

## Usage

Here is a basic application that demonstrates how to use the plugin.

```python
from __future__ import annotations

from litestar import Litestar

from litestar_saq import QueueConfig, SAQConfig, SAQPlugin

saq = SAQPlugin(config=SAQConfig(redis_url="redis://localhost:6397/0", queue_configs=[QueueConfig(name="samples")]))
app = Litestar(plugins=[saq])


```

You can start a background worker with the following command now:

```shell
litestar --app-dir=examples/ --app basic:app tasks run-worker
Using Litestar app from env: 'basic:app'
Starting SAQ Workers ──────────────────────────────────────────────────────────────────
INFO - 2023-10-04 17:39:03,255 - saq - worker - Worker starting: Queue<redis=Redis<ConnectionPool<Connection<host=localhost,port=6397,db=0>>>, name='samples'>
INFO - 2023-10-04 17:39:06,545 - saq - worker - Worker shutting down
```
