On Oct 22, 2:28 am, greg <[EMAIL PROTECTED]> wrote:
> sokol wrote:
> > Also, the
> > scheduler runs inside a loop. How do you suppose to
> > run other code while the loop is executing?
>
> The sleep function could be doing a select with a
> timeout on some other source of events, such as a
> socket
On 2008-10-21, sokol <[EMAIL PROTECTED]> wrote:
> On Oct 21, 2:19 am, greg <[EMAIL PROTECTED]> wrote:
>> sokol wrote:
>> > What was a surprise to me was that python sched.py makes the same
>> > mistake as I did in my first version.
>>
>> The sched module is *not* designed for multithreading. It
>>
sokol wrote:
Also, the
scheduler runs inside a loop. How do you suppose to
run other code while the loop is executing?
The sleep function could be doing a select with a
timeout on some other source of events, such as a
socket or a gui input event stream. One possible
response to such an event i
On Oct 21, 4:58 am, sokol <[EMAIL PROTECTED]> wrote:
> On Oct 21, 2:19 am, greg <[EMAIL PROTECTED]> wrote:
>
> > sokol wrote:
> > > What was a surprise to me was that python sched.py makes the same
> > > mistake as I did in my first version.
>
> > The sched module is *not* designed for multithreadi
On Oct 21, 2:19 am, greg <[EMAIL PROTECTED]> wrote:
> sokol wrote:
> > What was a surprise to me was that python sched.py makes the same
> > mistake as I did in my first version.
>
> The sched module is *not* designed for multithreading. It
> assumes that the thread waiting for events is the only o
sokol wrote:
What was a surprise to me was that python sched.py makes the same
mistake as I did in my first version.
The sched module is *not* designed for multithreading. It
assumes that the thread waiting for events is the only one
putting events into the queue, so it's impossible for an
eve
On Oct 20, 1:50 pm, Lie <[EMAIL PROTECTED]> wrote:
> On Oct 19, 4:01 am, sokol <[EMAIL PROTECTED]> wrote:
> > > > I started googling for scheduler and found one in standard library
> > > > but ih has the same code as mine (it calls the functions in the
> > > > right order and my doesn't, but it st
On Oct 19, 4:01 am, sokol <[EMAIL PROTECTED]> wrote:
> > > I started googling for scheduler and found one in standard library
> > > but ih has the same code as mine (it calls the functions in the
> > > right order and my doesn't, but it still waits too long).
> > > The other schedulers from web ar
On Oct 19, 4:01 am, sokol <[EMAIL PROTECTED]> wrote:
> > > I started googling for scheduler and found one in standard library
> > > but ih has the same code as mine (it calls the functions in the
> > > right order and my doesn't, but it still waits too long).
> > > The other schedulers from web ar
On Mon, Oct 20, 2008 at 5:31 AM, sokol <[EMAIL PROTECTED]> wrote:
>
>> from circuits.core import Manager, Component, Event, listener
>> from circuits.timers import Timer
>
> what is circuits?
If you're interested:
An event framework with a focus on Component architectures.
It can be downloaded cu
sokol wrote:
...
I see what you did there. You are keeping the queue empty
so you get notified for free, while I introduced a new
threading Condition to detect insertions.
All that is missing in your version is to put back all
pending tasks when somebody sends the stop (None) request.
Shouldn't
On Oct 19, 6:25 pm, Scott David Daniels <[EMAIL PROTECTED]> wrote:
> qvx wrote:
> > I need a scheduler which can delay execution of a
> > function for certain period of time.
> > My attempt was something like this: ... <<>>
> > Is there a better way or some library that does that?
>
> The trick is
> from circuits.core import Manager, Component, Event, listener
> from circuits.timers import Timer
what is circuits?
--
http://mail.python.org/mailman/listinfo/python-list
Scott David Daniels wrote:
def time_server(commands):
'''Process all scheduled operations that arrive on queue commands'''
...
queue = Queue.Queue()
thread.thread.start_new_thread(queue)
> queue.put((time.time() + dt, callable, args, {}))
> ...
And of course of the three lines that wer
qvx wrote:
I need a scheduler which can delay execution of a
function for certain period of time.
My attempt was something like this: ... <<>>
Is there a better way or some library that does that?
The trick is to use Queue's timeout argument to interrupt your sleep
when new requests come in.
On Sat, Oct 18, 2008 at 10:09 PM, qvx <[EMAIL PROTECTED]> wrote:
[ ... ]
> Is there a better way or some library that does that?
How about this ?
$ ./timerexamples.py
Time: 1224375945.336958
Timer 2 fired at: 1224375945.840600
Timer 1 fired at: 1224375955.336889
#!/usr/bin/env python
import
> > I started googling for scheduler and found one in standard library
> > but ih has the same code as mine (it calls the functions in the
> > right order and my doesn't, but it still waits too long).
> > The other schedulers from web are dealing with
> > repeating tasks and such.
>
>
> I believe
On Sat, Oct 18, 2008 at 5:09 AM, qvx <[EMAIL PROTECTED]> wrote:
> I need a scheduler which can delay execution of a
> function for certain period of time.
> My attempt was something like this:
>
[code snipped]
>
> But then I came up with the following case:
>
> 1. I call delay with delay_sec = 10
>
I need a scheduler which can delay execution of a
function for certain period of time.
My attempt was something like this:
def delay(self, func, arg, delay_sec=0):
fire_at = wallclock() + delay_sec
self.queue.put((fire_at, func, arg))
def runner(self):
while self.a
19 matches
Mail list logo