Created
December 7, 2019 04:07
-
-
Save schipiga/c01456f9c370853c13a87a3a709f7ea7 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 | |
def task(): | |
pid = os.fork() | |
if pid == 0: # child process | |
time.sleep(1) | |
os._exit(0) | |
pool = ProcessPool(max_workers=1) | |
with pool: | |
pool.schedule(task) | |
time.sleep(15) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment