Metadata-Version: 2.4
Name: tigrbl_engine_redis
Version: 0.1.1.dev14
Summary: Tigrbl engine plugin for Redis.
Author-email: Jacob Stewart <jacob@swarmauri.com>
License: Apache-2.0
Keywords: tigrbl,engine,plugin,redis,cache,database
Classifier: Development Status :: 1 - Planning
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Environment :: Plugins
Classifier: Intended Audience :: Developers
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries
Requires-Python: <3.13,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tigrbl>=0.3.0.dev4
Requires-Dist: redis>=5.0.0
Dynamic: license-file

# tigrbl_engine_redis

A Redis engine plugin for **tigrbl**. This package registers a new engine kind
`"redis"` that tigrbl auto-discovers via the `tigrbl.engine` entry-point group.

> The engine handle and session class in this package are implemented as
> **subclasses of tigrbl's first-class objects** (see notes below).

## Installation

```bash
pip install tigrbl_engine_redis
```

## Usage

Once installed, refer to `kind="redis"` in your engine spec:

```python
from tigrbl.engine.engine_spec import EngineSpec

spec = EngineSpec(kind="redis", mapping={"url": "redis://localhost:6379/0"})
eng, make_session = spec.build()  # resolved through entry-points
s = make_session()                # returns a RedisSession (TigrblSessionBase subclass)
```

### What this package provides

- `RedisEngine` — a thin subclass of `tigrbl.engine.Engine` to satisfy the
  "first‑class engine" requirement. It stores connection parameters for
  inspection; tigrbl keeps it as the provider's engine handle.
- `RedisSession` — a concrete subclass of `tigrbl.session.TigrblSessionBase`
  that wraps a `redis.asyncio.Redis` client and implements the async
  transaction‑aware Tigrbl Session ABC.
- `redis_engine()` — the entry‑point builder used by tigrbl to materialize
  `(engine_handle, session_factory)`.

> tigrbl auto‑loads engine plugins on import (idempotent). See:
> `tigrbl.engine.__init__` (calls `load_engine_plugins()`), and
> `tigrbl.engine.plugins.load_engine_plugins()` which enumerates the `tigrbl.engine`
> entry‑point group and invokes each package's `register()` function.
