in reply to Re^3: Using Net::Server::Multiplex and polling Spread
in thread Using Net::Server::Multiplex and polling Spread
to$mux->loop(sub { my ($rdready, $wrready) = @_; &check_sigs(); $mux->endloop if $prop->{_HUP}; });
All I did was add the line:$mux->loop(sub { my ($rdready, $wrready) = @_; &check_sigs(); $self->inner_loop_hook; # user customizable hook $mux->endloop if $prop->{_HUP}; });
And then I just defined my own hook function as:$self->inner_loop_hook; # user customizable hook
I haven't tested any of this with Spread yet which will take a while yet. Also I setup a timer with these lines at the top of the program.sub inner_loop_hook { print "Dude! " , time , "\n"; }
Which will wait 3 seconds before starting and then send a SIGALRM every 1 second after that.use Time::HiRes qw( setitimer getitimer ITIMER_REAL ITIMER_VIRTUAL ITIMER_PROF ); setitimer(ITIMER_REAL, 3, 1); $SIG{ALRM} = sub { return };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Using Net::Server::Multiplex and polling Spread
by perrin (Chancellor) on Jul 06, 2004 at 03:23 UTC | |
by superfrink (Curate) on Jul 09, 2004 at 18:14 UTC |