Metadata-Version: 2.4
Name: jentic-apitools-jobs
Version: 1.0.0a9
Summary: Jentic Apitools Jobs - Async job execution
Author: Jentic
Author-email: Jentic <hello@jentic.com>
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Requires-Dist: pydantic>=2.7,<3.0
Requires-Dist: pydantic-settings>=2.0.0
Requires-Dist: jentic-apitools-common~=1.0.0a9
Requires-Dist: jentic-apitools-pipelines~=1.0.0a9
Requires-Dist: redis>=5.0.0 ; extra == 'redis'
Requires-Dist: celery[redis]>=5.3.0 ; extra == 'redis'
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/jentic/jentic-apitools
Provides-Extra: redis
Description-Content-Type: text/markdown

# Jentic API Tools - Jobs

Async job execution with pluggable backends for running pipeline operations in the background. Supports in-memory thread pool (default) and optional Redis/Celery distributed execution.

## Key Features

The jobs package provides a `TaskRunner` abstraction with two implementations: `ThreadPoolRunner` for in-memory execution using a thread pool, and `CeleryRunner` for distributed execution via Redis and Celery. A `create_task_runner` factory selects the appropriate runner based on configuration. Job state is tracked through `JobStorage` (with `MemoryJobStorage` and Redis-backed implementations). Progress is reported through `ProgressReporter` objects that support SSE streaming to API clients. Periodic cleanup removes expired jobs and optionally their output directories.

## Dependencies

Internal: `jentic.apitools.common`, `jentic.apitools.pipelines`. Optional: redis, celery[redis].

## Installation

```bash
pip install jentic-apitools-jobs
```

## Quick Start

```python
from jentic.apitools.jobs import create_task_runner
from jentic.apitools.common.models import JobOperation

runner = create_task_runner()
runner.storage.create_job("job-1", JobOperation.SCORE)
runner.submit_job("job-1", JobOperation.SCORE, {"spec_url": "https://example.com/api.json"})
```

## Testing

```bash
pytest tests -v
```
