Last active
December 7, 2019 04:57
-
-
Save schipiga/d0e4cf16836d06e023d39d9fd06a43ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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