canopy_bot
canopy job queue
JobQueue
spawns a pool of workers (default 20
) in a gevent.queue.PriorityQueue
. JSON encoded 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_identifier, browser)
listing A A
Classes
JobQueue
run(self, stdin, log)
listing A A
Metrics
Lines of Code
Source | Docstrings | Comments |
---|---|---|
92 | 0 | 18 |