Skip to content

Instantly share code, notes, and snippets.

@schipiga
Last active December 7, 2019 04:57
Show Gist options
  • Save schipiga/d0e4cf16836d06e023d39d9fd06a43ca to your computer and use it in GitHub Desktop.
Save schipiga/d0e4cf16836d06e023d39d9fd06a43ca to your computer and use it in GitHub Desktop.
import os
import time
from pebble import ProcessPool
from subprocess import Popen
def task():
Popen(['sleep', '30'])
print('task done')
pool = ProcessPool(max_workers=1)
with pool:
pool.schedule(task)
pool.schedule(task)
pool.schedule(task)
time.sleep(15)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment