Modern Redis task queue for Python 3
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
doc
examples
spinach
tests
.coveragerc
.gitignore
.travis.yml
LICENSE
Makefile
README.rst
pytest.ini
setup.py

README.rst

Spinach

https://travis-ci.org/NicolasLM/spinach.svg?branch=master https://coveralls.io/repos/github/NicolasLM/spinach/badge.svg?branch=master https://readthedocs.org/projects/spinach/badge/?version=latest

Redis task queue for Python 3 heavily inspired by Celery and RQ.

Distinctive features:

  • At-least-once or at-most-once delivery per task
  • Periodic tasks without an additional process
  • Scheduling of tasks in batch
  • Integrations with Flask, Django, Logging and Sentry
  • Embeddable workers for easier testing
  • Python 3, threaded, explicit... see design choices for more details

Quickstart

Install Spinach with pip:

pip install spinach

Create task and schedule two jobs, one executed now and one later:

from spinach import Engine, MemoryBroker

spin = Engine(MemoryBroker())


@spin.task(name='compute')
def compute(a, b):
    print('Computed {} + {} = {}'.format(a, b, a + b))


# Schedule a job to be executed ASAP
spin.schedule(compute, 5, 3)

print('Starting workers, ^C to quit')
spin.start_workers()

Documentation

The documentation is at https://spinach.readthedocs.io.

License

BSD 2-clause