Rename call_later() arg when to delay.
This commit is contained in:
parent
7a660f8674
commit
4833721914
12
pep-3156.txt
12
pep-3156.txt
|
@ -169,7 +169,7 @@ A conforming event loop object has the following methods:
|
|||
|
||||
Note: run() blocks until the termination condition is met.
|
||||
|
||||
TBD: run() may need an argument to start some work.
|
||||
TBD: run() may need an argument to start some work?
|
||||
|
||||
- TBD: Do we need an API for stopping the event loop, given that we
|
||||
have the termination condition? Is the termination condition
|
||||
|
@ -178,9 +178,9 @@ A conforming event loop object has the following methods:
|
|||
- TBD: Do we need an API to run the event loop for a little while
|
||||
(e.g. a single iteration)? If so, exactly what should it do?
|
||||
|
||||
- ``call_later(when, callback, *args)``. Arrange for
|
||||
``callback(*args)`` to be called approximately ``when`` seconds in
|
||||
the future, once, unless canceled. As usual in Python, ``when`` may
|
||||
- ``call_later(delay, callback, *args)``. Arrange for
|
||||
``callback(*args)`` to be called approximately ``delay`` seconds in
|
||||
the future, once, unless canceled. As usual in Python, ``delay`` may
|
||||
be a floating point number to represent smaller intervals. Returns
|
||||
a ``DelayedCall`` object representing the callback, whose
|
||||
``cancel()`` method can be used to cancel the callback.
|
||||
|
@ -201,6 +201,8 @@ A conforming event loop object has the following methods:
|
|||
``isinstance(callback, DelayedCall)``? It should silently skip
|
||||
a canceled callback.
|
||||
|
||||
- TBD: Repeatable timers.
|
||||
|
||||
Some methods in the standard conforming interface return Futures:
|
||||
|
||||
- ``wrap_future(future)``. This takes a PEP 3148 Future (i.e., an
|
||||
|
@ -346,7 +348,7 @@ guarantees that ``foo()`` is called before ``bar()``.
|
|||
If ``call_soon()`` is used, this guarantee is true even if the system
|
||||
clock were to run backwards. This is also the case for
|
||||
``call_later(0, callback, *args)``. However, if ``call_later()`` is
|
||||
used with a nonzero ``when`` argument, all bets are off if the system
|
||||
used with a nonzero delay, all bets are off if the system
|
||||
clock were to runs backwards. (A good event loop implementation
|
||||
should use ``time.monotonic()`` to avoid problems when the clock runs
|
||||
backward. See PEP 418.)
|
||||
|
|
Loading…
Reference in New Issue