In the recent unreleased
async_timeout version there are two ways to create a timeout:
async with timeout(5) as cm: # schedule timeout for 5 seconds after the current time
loop = asyncio.get_running_loop() when = loop.time() + 5 async with timeout_at(when) as cm: # schedule timeout at when exact time; # in this case the same as above example
So far so good.
I want to reschedule already existing timeout, again a) for a delay and b) at absolute time.
The version on master uses
cm.shift_at() names. I’m not very happy with it.
The proper naming might be
reschedule_at() but the word is too long I think. Another candidate is reusing
async with timeout(5) as cm: await asyncio.sleep(2) cm.timeout(5) # extend the timeout for 5 seconds from now
Thesaurus suggests other words like retard or linger, I really don’t know what is better for native English speaker.
Suggestions for the naming are welcome!