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