Classic debounce function:
const debounce = (fn, delay) => {
let timer = null;
return function (...args) {
const context = this;
timer && clearTimeout(timer);
timer = setTimeout(() => {
#!/usr/bin/python | |
# module with simple class to build PDF documents with basic PDF elements | |
# Source code put in public domain by Didier Stevens, no Copyright | |
# https://DidierStevens.com | |
# Use at your own risk | |
# | |
# History: | |
# | |
# 2008/05/18: continue |
import json | |
import os | |
import requests | |
from copy import copy | |
# To run try this out, run --> `python coroutines.py` | |
Similar to mpipe, this short module lets you string together tasks so that they are executed in parallel.
The difference is that it lets you use generators, functions which yield results instead of returning them. Each yielded item gets passed to the next stage.
You can specify that one or more copies of the workers operate on the input queue.