@@ -69,35 +69,48 @@ Please note: it is not POSIX time but a time with
6969undefined starting base, e.g. the time of the system power on.
7070
7171
72- Context manager has ``.expired `` property for check if timeout happens
72+ Context manager has ``.expired() `` / `` .expired `` for check if timeout happens
7373exactly in context manager::
7474
7575 async with timeout(1.5) as cm:
7676 await inner()
77- print(cm.expired)
77+ print(cm.expired()) # recommended api
78+ print(cm.expired) # compatible api
7879
7980The property is ``True `` if ``inner() `` execution is cancelled by
8081timeout context manager.
8182
8283If ``inner() `` call explicitly raises ``TimeoutError `` ``cm.expired ``
8384is ``False ``.
8485
85- The scheduled deadline time is available as ``.deadline `` property ::
86+ The scheduled deadline time is available as ``.when() `` / `` .deadline `` ::
8687
8788 async with timeout(1.5) as cm:
88- cm.deadline
89+ cm.when() # recommended api
90+ cm.deadline # compatible api
8991
90- Not finished yet timeout can be rescheduled by ``shift_by () ``
91- or ``shift_to () `` methods::
92+ Not finished yet timeout can be rescheduled by ``shift () ``
93+ or ``update () `` methods::
9294
9395 async with timeout(1.5) as cm:
96+ # recommended api
97+ cm.reschedule(cm.when() + 1) # add another second on waiting
98+ # compatible api
9499 cm.shift(1) # add another second on waiting
95100 cm.update(loop.time() + 5) # reschedule to now+5 seconds
96101
97102Rescheduling is forbidden if the timeout is expired or after exit from ``async with ``
98103code block.
99104
100105
106+ Disable scheduled timeout::
107+
108+ async with timeout(1.5) as cm:
109+ cm.reschedule(None) # recommended api
110+ cm.reject() # compatible api
111+
112+
113+
101114Installation
102115------------
103116
0 commit comments