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