Beispiel #1
0
 async def inside_listener(event: interrupt.direct):
     if active_stat.get():
         return RemoveMe()
     try:
         result = await run_always_await(interrupt.trigger(event))
         if result is not None:
             active_stat.set()
             event_lock.set()
             interrupt.set_return_value(result)
             if not interrupt._block_propagation:
                 return RemoveMe()
             raise PropagationCancelled()
     except:
         import traceback
         traceback.print_exc()
        async def inside_listener(event: event_type):
            if future.done():
                return RemoveMe()

            result = await self.broadcast.Executor(
                target=ExecTarget(
                    callable=waiter.detected_event,
                    inline_dispatchers=waiter.using_dispatchers,
                    headless_decorators=waiter.using_decorators,
                ),
                dispatchers=dispatcher_mixin_handler(event.Dispatcher),
            )

            if result is not None:
                future.set_result(result)
                if not waiter.block_propagation:
                    return RemoveMe()
                raise PropagationCancelled()
Beispiel #3
0
        async def inside_listener(event: event_type):
            if active_stat.get():
                return RemoveMe()

            result = await self.broadcast.Executor(
                target=ExecTarget(
                    callable=waiter.detected_event,
                    inline_dispatchers=waiter.using_dispatchers,
                    headless_decoraters=waiter.using_decorators,
                    enable_internal_access=waiter.enable_internal_access,
                ),
                event=event,
            )

            if result is not None:
                active_stat.set()
                event_lock.set()
                value_container.setValue(result)
                if not waiter.block_propagation:
                    return RemoveMe()
                raise PropagationCancelled()