15 Matching Annotations
- Jun 2022
-
insomnius.github.io insomnius.github.io
- Mar 2022
- Oct 2021
-
www.kylehq.com www.kylehq.com
-
QueueStore
-
export interface QueueInterface { count(): number; dequeue?(): any; enqueue(...args: any): void; flush(): any[]; reset(): void; setFifo(fifo: boolean): void; setLifo(lifo: boolean): void; truncate(length: number): void; } export class queue { protected elements: any[]; protected fifo = true; constructor(…args: any) { this.elements = […args]; } count() { return this.elements.length; } dequeue?(): any { if (this.fifo) { return this.elements.shift(); } return this.elements.pop(); } enqueue(…args: any) { return this.elements.push(…args); } // Like dequeue but will flush all queued elements flush(): any[] { let elms = []; while (this.count()) { elms.push(this.dequeue()); } return elms; } setFifo(fifo = true) { this.fifo = fifo; } setLifo(lifo = true) { this.fifo = !lifo; } reset(): void { this.truncate(0); } truncate(length: number) { if (Number.isInteger(length) && length > -1) { this.elements.length = length; } } } export default queue;
-
- Oct 2020
-
academic.oup.com academic.oup.com
-
Harries, A. D., Martinez, L., & Chakaya, J. M. (n.d.). SARS-CoV-2: How safe is it to fly and what can be done to enhance protection? Transactions of The Royal Society of Tropical Medicine and Hygiene. https://doi.org/10.1093/trstmh/traa106
-
- Apr 2020
-
en.wikipedia.org en.wikipedia.org
-
-
In a priority queue, an element with high priority is served before an element with low priority.
-
-
github.com github.comrq/rq1
-
def handle_exception(self, job, *exc_info):
To unit test an exception handler:
worker = Worker(..., exception_handler=[handle_exception]) try: raise Exception() except Exception: exc_info = sys.exc_info() worker.handle_exception(job, *exc_info)
-
-
python-rq.org python-rq.orgRQ: Jobs3
-
failure_ttl
How long to keep a failed job.
-
result_ttl=600
How long to keep a successful job.
-
job.meta['handled_by'] = socket.gethostname() job.save_meta()
You can add metadata on the job like keeping track of the number of times a job has been retried for example.
Tags
Annotators
URL
-
-
python-rq.org python-rq.org
-
w = Worker([q], exception_handlers=[foo_handler, bar_handler])
Exception handlers are attached to the worker.
-
def my_handler(job, exc_type, exc_value, traceback): # do custom things here
Write an exception handler that requeues a failed job.
Tags
Annotators
URL
-
- Nov 2018