classification
Title: Undocumented features of asyncio: call_at, call_later
Type: enhancement Stage: commit review
Components: asyncio, Documentation Versions: Python 3.6, Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, gvanrossum, python-dev, socketpair, vstinner, yselivanov
Priority: normal Keywords:

Created on 2015-06-25 07:37 by socketpair, last changed 2015-06-25 17:52 by yselivanov. This issue is now closed.

Messages (5)
msg245803 - (view) Author: Марк Коренберг (socketpair) * Date: 2015-06-25 07:37
These function returns handle, so, registered callback can be cancelled.
msg245804 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-06-25 07:52
Documentatin of call_soon() and call_later() contain the sentence "An instance of asyncio.Handle is returned." with a link to Handle which shows the cancel() method:

https://docs.python.org/dev/library/asyncio-eventloop.html#asyncio.BaseEventLoop.call_soon

https://docs.python.org/dev/library/asyncio-eventloop.html#asyncio.BaseEventLoop.call_later

Can you please suggest a new sentence to explain that a Handle can be cancelled?
msg245806 - (view) Author: Марк Коренберг (socketpair) * Date: 2015-06-25 09:35
For delayed execution methods:

"Returned handle is actually timer object. That timer can be deactivated using asyncio.Handle.cancel() method, so registered callback won't be called".

For other callback registration methods:

"Returned handle may be used to unregister callback using asyncio.Handle.cancel(), so registered callback won't be called".


Also:
1. Documentation of .cancel does not say if it is allowed to cancel cancelled handle.
2. Documentation does not say if it is allowed to cancel timer, that was already fired.
msg245822 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-06-25 17:50
New changeset 3199ec504dbe by Yury Selivanov in branch '3.4':
Issue #24509: Clarify Handle.cancel() and loop.call_* methods.
https://hg.python.org/cpython/rev/3199ec504dbe

New changeset fc69dd6aea55 by Yury Selivanov in branch '3.5':
Merge 3.4 (issue #24509)
https://hg.python.org/cpython/rev/fc69dd6aea55

New changeset 9aad116baee8 by Yury Selivanov in branch 'default':
Merge 3.5 (issue #24509)
https://hg.python.org/cpython/rev/9aad116baee8
msg245823 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2015-06-25 17:52
Thanks for reporting this Mark!
History
Date User Action Args
2015-06-25 17:52:08yselivanovsetstatus: open -> closed
versions: + Python 3.4, Python 3.5
messages: + msg245823

resolution: fixed
stage: commit review
2015-06-25 17:50:52python-devsetnosy: + python-dev
messages: + msg245822
2015-06-25 09:35:08socketpairsetmessages: + msg245806
2015-06-25 07:52:10vstinnersetmessages: + msg245804
2015-06-25 07:38:21socketpairsetassignee: docs@python

type: enhancement
components: + Documentation, asyncio
nosy: + gvanrossum, docs@python, vstinner, yselivanov
2015-06-25 07:37:50socketpaircreate