arrrrgv has asked for the wisdom of the Perl Monks concerning the following question:
I wrote an script where I wait for events as soon as I'm waiting for messages through the network, any way I do so like this:
#!/usr/bin/perl use Event; sub whatever{ #here I do my staff waiting for messages through the spread toolk +it #Here I could check what time is if N time has passed i could do + anything, but i have no way to check it if not any event has hapenne +d. } #here I launch it on event Event->io(fd => $spread->fd, cb => \&put_output); Event::loop();
My main problem is that once I'm inside the sub I can control the time has passed as soon as messages (events are comming, but if i don't received anything I have no way to control if N time has passed.
What I can do to add control time the Event if nothing happens?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: on event but after an interval?
by moritz (Cardinal) on Aug 22, 2011 at 11:18 UTC | |
|
Re: on event but after an interval?
by GrandFather (Saint) on Aug 22, 2011 at 12:10 UTC | |
|
Re: on event but after an interval?
by locked_user sundialsvc4 (Abbot) on Aug 22, 2011 at 12:26 UTC |