Beispiel #1
0
 def worker(*args):
     run_async_from_thread(sleep, *args)
     return True
Beispiel #2
0
 def worker(a, b):
     assert threading.get_ident() != event_loop_thread_id
     return run_async_from_thread(add, a, b)
Beispiel #3
0
 def thread_func() -> int:
     with pytest.deprecated_call():
         return run_async_from_thread(get_ident)
Beispiel #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)
Beispiel #5
0
 def worker(a, b):
     assert not is_in_event_loop_thread()
     return run_async_from_thread(add, a, b)