MCPcopy Create free account
hub / github.com/ActiveState/code / async_int

Function async_int

recipes/Python/577959_Run_async_code_inline/recipe-577959.py:10–17  ·  view source on GitHub ↗
(gen)

Source from the content-addressed store, hash-verified

8 Q.put((a,b))
9
10def async_int(gen):
11 try: gen.next()
12 except StopIteration: return
13 def do():
14 try: gen.next()
15 except StopIteration: return
16 idle_add(async_int, gen)
17 threading.Thread(target=do).start()
18
19def async(func):
20 return lambda *a,**kw: async_int(func(*a,**kw))

Callers 1

recipe-577959.pyFile · 0.70

Calls 2

nextMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected