Angelo Gladding
lahacker.net

dlv5vbq7lzlthol5 4b942a3185b37d00

South Pasadena, California, United States
72°F

CodecanopyAPI

loveliness

canopy job queue

JobQueue spawns a pool of workers in a gevent.queue.PriorityQueue. JSON encoded job inputs are routed through a list at key jobqueue in the environment's Redis database (eg. KVDB=./path/to/redis.sock).

>>> # enqueues a job to fetch a resource at Alice's site root
>>> canopy.enqueue(canopy.get, "https://alice.example.org")
>>> # sets a schedule to enqueue the same job every three minutes
>>> canopy.enqueue(canopy.get, "https://alice.example.org",
...                _schedule="*/3 * * * *")

The idea is to have all outgoing tasks piped through this queue, no matter how trivial. Web responses should be instantaneous. Once in the background tasks can be managed restarted, reprioritized, canceled, delayed, etc.

Members

Metrics

full listing

Lines of Code

Source Docstrings Comments
140 0 19