Skip to main content

Fennel

A task queue for Python 3.7+ based on Redis Streams with a Celery-like API.

https://fennel.dev/

Note: This is an alpha release. The project is under development, breaking changes are likely.

Features

  • Supports both sync (e.g. Django, Flask) and async (e.g. Starlette, FastAPI) code.
  • Sane defaults: at least once processing semantics, tasks acknowledged on completion.
  • Automatic retries with exponential backoff for fire-and-forget jobs.
  • Clear task statuses available (e.g. sent, executing, success).
  • Automatic task discovery (defaults to using **/tasks.py).
  • Exceptionally small and understandable codebase.

Installation

pip install fennel

Basic Usage

Run Redis and then execute your code in tasks.py:

from fennel import App

app = App(name='myapp', redis_url='redis://127.0.0.1')


@app.task
def foo(n):
    return n


# Enqueue a task to be executed in the background by a fennel worker process.
foo.delay(7)

Meanwhile, run the worker:

$ fennel worker --app tasks:app

Asynchronous API

Fennel also supports an async API. If your code is running in an event loop (e.g. via Starlette or FastAPI), you will want to use the async interface instead:

from fennel import App

app = App(name='myapp', redis_url='redis://127.0.0.1', interface='async')


@app.task
async def bar(x):
    return x


await bar.delay(5)

See also

If you need to ensure that all tasks for a given key are processed in-order, please see our sister project Runnel.

Release files for fennel 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fennel 0.3.0
File Size Uploaded
fennel-0.3.0.tar.gz 23.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fennel 0.3.0
File Interpreter ABI Platform
fennel-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 58.6 kB

Release files / fennel-0.3.0.tar.gz

Download URL fennel-0.3.0.tar.gz
Size 23.9 kB
Tags Source
SHA-256 checksum
How to use checksums
15fdd2f503dbc5218252025ef375adb4da367de458ab950dc3b2cb1ce3d935c0
BLAKE2b-256 checksum
How to use checksums
9441a85b6aa25b8bdc4df7e1a19e1cad04a3c3a3600107ed961ecd676abe6ef9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.10 CPython/3.8.5 Linux/5.3.0-1034-azure

Release files / fennel-0.3.0-py3-none-any.whl

Download URL fennel-0.3.0-py3-none-any.whl
Size 34.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef3d3561c42298c0ea1c6529a942d3e1b86ca78e265345ff9cb6e6f135a71c43
BLAKE2b-256 checksum
How to use checksums
29611e33e1be7003096607e8b9735969ca27e9f40d7700318cbec23cd5df184c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.10 CPython/3.8.5 Linux/5.3.0-1034-azure

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page