[Bps-public-commit] r10945 - in Net-Server-Coro: .
alexmv at bestpractical.com
alexmv at bestpractical.com
Wed Feb 27 13:55:04 EST 2008
Author: alexmv
Date: Wed Feb 27 13:55:02 2008
New Revision: 10945
Modified:
Net-Server-Coro/ (props changed)
Net-Server-Coro/lib/Net/Server/Coro.pm
Log:
r28145 at zoq-fot-pik: chmrr | 2008-02-27 13:54:23 -0500
* Use EV signal handlers
Modified: Net-Server-Coro/lib/Net/Server/Coro.pm
==============================================================================
--- Net-Server-Coro/lib/Net/Server/Coro.pm (original)
+++ Net-Server-Coro/lib/Net/Server/Coro.pm Wed Feb 27 13:55:02 2008
@@ -66,11 +66,10 @@
$Coro::current->prio(3);
$Coro::current->desc("Event loop");
- # EV needs to service something before we notice signals.
- # This interrupts the event loop every 10 seconds to force it
- # to check if we got sent a SIGINT, for instance. Otherwise
- # it would hang until it got an I/O interrupt.
- my $death_notice = EV::timer( 5, 5, sub { } );
+ # Use EV signal handlers;
+ my @shutdown = map EV::signal( $_ => sub { $self->server_close; } ),
+ qw/INT TERM QUIT/;
+ my $hup = EV::signal( HUP => sub { $self->sig_hup } );
while (1) {
EV::loop();
}
More information about the Bps-public-commit
mailing list