Exemplo n.º 1
0
 def worker(*args):
     run_async_from_thread(sleep, *args)
     return True
Exemplo n.º 2
0
 def worker(a, b):
     assert threading.get_ident() != event_loop_thread_id
     return run_async_from_thread(add, a, b)
Exemplo n.º 3
0
 def thread_func() -> int:
     with pytest.deprecated_call():
         return run_async_from_thread(get_ident)
Exemplo n.º 4
0
 def thread_worker():
     nonlocal last_active
     run_async_from_thread(sleep_event.set)
     time.sleep(0.2)
     last_active = 'thread'
     run_async_from_thread(finish_event.set)
Exemplo n.º 5
0
 def worker(a, b):
     assert not is_in_event_loop_thread()
     return run_async_from_thread(add, a, b)