Skip to content

v4.3.0

Compare
Choose a tag to compare
@PeterJCLaw PeterJCLaw released this 10 Nov 17:13
· 163 commits to master since this release

Support bulk enqueueing of jobs

Adds a new API task.bulk_enqueue which supports enqueueing jobs in bulk. It is up to each backend to support this -- the default behaviour falls back to individual enqueueing of the jobs in a loop. Currently this is only any more efficient when using the Redis backends (where each batch becomes a single LPUSH operation).

Usage looks like this:

    with my_task.bulk_enqueue() as enqueue:
        enqueue(the_ids=[42, 43])
        enqueue(the_ids=[45, 46])

This is equivalent to:

    my_task(the_ids=[42, 43])
    my_task(the_ids=[45, 46])