[Catalyst-commits] r13774 - Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Script

rafl at dev.catalyst.perl.org rafl at dev.catalyst.perl.org
Sun Dec 5 17:35:08 GMT 2010


Author: rafl
Date: 2010-12-05 17:35:08 +0000 (Sun, 05 Dec 2010)
New Revision: 13774

Modified:
   Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Script/Server.pm
Log:
After startup, tell where the server is listening

Modified: Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Script/Server.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Script/Server.pm	2010-12-05 17:29:13 UTC (rev 13773)
+++ Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Script/Server.pm	2010-12-05 17:35:08 UTC (rev 13774)
@@ -184,6 +184,15 @@
         port => $self->port,
         host => $self->host,
         keepalive => $self->keepalive ? 100 : 1,
+        server_ready => sub {
+            my ($args) = @_;
+
+            my $name  = $args->{server_software} || ref($args); # $args is $server
+            my $host  = $args->{host} || 0;
+            my $proto = $args->{proto} || 'http';
+
+            print STDERR "$name: Accepting connections at $proto://$host:$args->{port}/\n";
+        },
     );
 }
 




More information about the Catalyst-commits mailing list