Skip to content

Instantly share code, notes, and snippets.

@saghul saghul/t.py
Created Feb 11, 2013

Embed
What would you like to do?
import rose
from tulip import events
from tulip import tasks
#events.set_event_loop_policy(rose.EventLoopPolicy())
reactor = events.get_event_loop()
def _foo():
x = 0
while x < 10:
print("ping")
yield from (tasks.sleep(0.1))
x += 1
if x == 5:
reactor.stop()
reactor.run_until_complete(tasks.Task(_foo()))
print("stop")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.