Skip to content

Instantly share code, notes, and snippets.

@hpk42
Created September 11, 2013 14:07
Show Gist options
  • Save hpk42/6524082 to your computer and use it in GitHub Desktop.
Save hpk42/6524082 to your computer and use it in GitHub Desktop.
import sys
import execnet
gw = execnet.makegateway("popen")
ch = gw.remote_exec("""
while 1:
data = channel.receive()
if data:
channel.send(data)
else:
break
""")
for i in range(1000):
ch.send(1)
ch.receive()
ch.send(None)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment