Issue 13449: sched - provide an "async" argument for run() method (original) (raw)

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/57658

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 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:24 admin set github: 57658
2011-12-14 13:41:46 giampaolo.rodola set nosy: + josiahcarlson, josiah.carlson
2011-12-14 13:41:06 giampaolo.rodola set status: open -> closedassignee: giampaolo.rodolaresolution: fixedstage: patch review -> resolved
2011-12-14 13:38:51 python-dev set nosy: + python-devmessages: +
2011-12-14 13:07:04 giampaolo.rodola set messages: +
2011-12-14 12:58:03 pitrou set messages: +
2011-12-14 12:54:21 giampaolo.rodola set messages: +
2011-12-02 16:27:21 ezio.melotti set type: enhancementcomponents: + Library (Lib)stage: patch review
2011-11-22 00:43:05 pitrou set nosy: + pitroumessages: +
2011-11-22 00:19:54 giampaolo.rodola set files: + sched-async.patchkeywords: + patch
2011-11-22 00:19:43 giampaolo.rodola create