Skip to content

Instantly share code, notes, and snippets.

@schipiga
Created December 7, 2019 04:26
Show Gist options
  • Save schipiga/ce1cc33a94d222026f2d002d6bbe92f7 to your computer and use it in GitHub Desktop.
Save schipiga/ce1cc33a94d222026f2d002d6bbe92f7 to your computer and use it in GitHub Desktop.
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