Skip to content

Instantly share code, notes, and snippets.

@mixxen
Created November 17, 2019 00:54
Show Gist options
  • Save mixxen/d15746843339b5d63b04334ecf0503f2 to your computer and use it in GitHub Desktop.
Save mixxen/d15746843339b5d63b04334ecf0503f2 to your computer and use it in GitHub Desktop.
from multiprocessing import Process, Pipe
from time import sleep
def f(conn):
while True:
print(conn.recv())
if __name__ == '__main__':
parent_conn, child_conn = Pipe()
p = Process(target=f, args=(child_conn,))
p.start()
ii = 0
while True:
parent_conn.send([ii, None, 'hello'])
ii = ii + 1
sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment