Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import sys
import logging
from multiprocessing.pool import Pool
logging.basicConfig(stream=sys.stdout, level=logging.INFO,
format='%(asctime)s - %(processName)s %(threadName)s - %(name)s - %(levelname)s - %(message)s')
if __name__ == "__main__":
def job(name):
logger = logging.getLogger(name)"balabala")
size = 5
pool = Pool(size)
futures = [pool.apply_async(job, args=('Job-%d' % i, )) for i in range(size)]
[f.get() for f in futures]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment