Hi,

Excuse me if such trivial questions were already answered, but I failed to 
find any traces of them.

Assume I want to make a delayed call:

    handler = loop.call_later(delay, callback)

How can I check if callback was called for _now_? 
Handler seems only provides a way to cancel a call, not to check it status: 
is called, failed with exception etc.

If the callback failed, how can I get an exception of it? 
loop.set_exception_handler seems is designed to catch everything, but I 
need to catch exact that callback failure.

Bonus: what's the best way to delay call (delay yield from) coroutines? I 
guess is something like that:

    @asyncio.coroutine
    def yield_later(delay, coro):
        yield from asyncio.sleep(delay)
        yield from coro

    asyncio.async(yield_later(delay, mycoro(foo, bar=baz)))

but just want to make sure.

For now, the only solution I see is about wrap callback with additional 
functions in order to catch and process raised exceptions, set an Event in 
order to notify callee about callback call and so on, but doing all this I 
have a strange feel that I miss something oblivious. So do I?

--
,,,^..^,,,


Reply via email to