This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Unsupported provider

classification
Title: sched - provide an "async" argument for run() method
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: giampaolo.rodola Nosy List: giampaolo.rodola, josiah.carlson, josiahcarlson, pitrou, python-dev
Priority: normal Keywords: patch

Created on 2011-11-22 00:19 by giampaolo.rodola, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
sched-async.patch giampaolo.rodola, 2011-11-22 00:19 review
Messages (6)
msg148095 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2011-11-22 00:19
If True it would run the scheduled functions due to expire soonest (if any) and then return.
This would make sched module usable into asynchronous applications.
msg148097 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-11-22 00:43
I think this would be better served by a separate method. You could call it e.g. run_nowait().
msg149443 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2011-12-14 12:54
What about run(nowait=...) or run(only_ready=...)?
Doing this as a separate method seems unnecessarily complicated to me in terms of implementation (move run logic into _run, add "run" and "run_nowait", etc...).
Most importantly, the user will have to remember two methods which are basically equivalent in terms of "what they actually do".
msg149444 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-12-14 12:58
That's a good point. Then perhaps call the flag "wait" or "blocking", since it avoids false positives and is more explicit than "async"?
msg149445 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2011-12-14 13:07
"blocking" seems the most explicit to me.
With this, we can also fix issue1641 by providing a specific section into asyncore doc which explains how to use asyncore in conjunction with sched.
msg149448 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-12-14 13:38
New changeset 2975618965c0 by Giampaolo Rodola' in branch 'default':
Fix #13449: add 'blocking' parameter to sched.scheduler.run() so that the scheduler can be used in non-blocking applications
http://hg.python.org/cpython/rev/2975618965c0
History
Date User Action Args
2022-04-11 14:57:24adminsetgithub: 57658
2011-12-14 13:41:46giampaolo.rodolasetnosy: + josiahcarlson, josiah.carlson
2011-12-14 13:41:06giampaolo.rodolasetstatus: open -> closed
assignee: giampaolo.rodola
resolution: fixed
stage: patch review -> resolved
2011-12-14 13:38:51python-devsetnosy: + python-dev
messages: + msg149448
2011-12-14 13:07:04giampaolo.rodolasetmessages: + msg149445
2011-12-14 12:58:03pitrousetmessages: + msg149444
2011-12-14 12:54:21giampaolo.rodolasetmessages: + msg149443
2011-12-02 16:27:21ezio.melottisettype: enhancement
components: + Library (Lib)
stage: patch review
2011-11-22 00:43:05pitrousetnosy: + pitrou
messages: + msg148097
2011-11-22 00:19:54giampaolo.rodolasetfiles: + sched-async.patch
keywords: + patch
2011-11-22 00:19:43giampaolo.rodolacreate