[issue20126] sched doesn't handle events added after scheduler starts
lo...@blossomhillranch.com added the comment: i saw that issue before i submitted this one, but it says it was fixed a year ago. i assumed a patch from a year ago would be in 3.3.1. when i see an issue closed with a patch accepted, how do i determine which python version will contain that patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20126 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20126] sched doesn't handle events added after scheduler starts
lo...@blossomhillranch.com added the comment: i looks like a different issue. 16165 says you can't add events while the scheduler is running. in my case, i can add them, but they don't run at the correct time. i'll guess at what the problem is... when you start the scheduler, the thread sleeps until the first scheduled event. when you add an event after the scheduler is running, the scheduler doesn't re-evaluate how long it should sleep. sched.enter(), sched.enterabs(), and sched.cancel() should probably send a signal to the scheduler thread to recalculate the time of the next event. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20126 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20126] sched doesn't handle events added after scheduler starts
lo...@blossomhillranch.com added the comment: ok, makes sense. can we put a note in the manual about this limitation? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20126 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20126] sched doesn't handle events added after scheduler starts
New submission from lo...@blossomhillranch.com: Events added after the scheduler is running, with a delay value before the next event, do not run at the correct time. import sched import time import threading def event( eventNum ): print( 'event', eventNum, time.time() ) s = sched.scheduler() s.enter( 0,1,event, (0,) ) s.enter(10,1,event, (1,) ) t = threading.Thread( target = s.run ) t.start() s.enter( 5,1,event, (2,) ) OUTPUT event 0 1388890197.7716181 event 2 1388890207.7340584 event 1 1388890207.7347224 -- messages: 207336 nosy: lo...@blossomhillranch.com priority: normal severity: normal status: open title: sched doesn't handle events added after scheduler starts type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20126 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com