AG

Angelo Gladding
lahacker.net

dlv5vbq7lzlthol5 4b942a3185b37d00

Home CodecanopyAPI

canopy_bot

canopy job queue

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

The following example enqueues a request to a resource at Alice's site.

> canopy.enqueue(canopy.post, "https://alice.example.org")

The idea is to have all tasks piped through this queue, no matter how trivial. Web responses should be instantaneous. Background tasks can be trivially restarted, reprioritized, canceled, etc.

Members

Functions

work(browser)

listing A A

handle(job, browser)

listing A A

Classes

JobQueue

run(self, stdin, log)

listing A A

Metrics

full listing

Lines of Code

Source Docstrings Comments
41 0 12