Skip to content

0xDEC0DE/spinach

 
 

Repository files navigation

Spinach

image

image

image

image

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

Distinctive features:

  • Threaded and asyncio workers
  • At-least-once or at-most-once delivery per task
  • Periodic tasks without an additional process
  • Concurrency limits on queued jobs
  • Scheduling of tasks in batch
  • Integrations with Flask, Django, Logging, Sentry and Datadog
  • Embeddable workers for easier testing
  • See design choices for more details

Quickstart

Install Spinach with pip:

pip install spinach

Create a task and schedule a job to be executed now:

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.

IRC channel for online discussions #spinach on irc.libera.chat.

License

BSD 2-clause

About

Modern Redis task queue for Python 3

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 92.2%
  • Lua 7.8%