Created
December 7, 2019 04:26
-
-
Save schipiga/ce1cc33a94d222026f2d002d6bbe92f7 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) | |
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