Do the right thing with FCGI args, the hostname and the keepalive options in the...
Tomas Doran [Tue, 12 Jan 2010 01:30:26 +0000 (01:30 +0000)]
There are still a load of options for the dev server (like writing a PID file) that we'll need to add to the plack server (or do ourselves manually?), and the entire set of options we actually pass into the application via ->run is unused by it.

I'm not sure if we are safe to change the original option passing convention or not - need to look at alternate engines and stuff..

lib/Catalyst/Script/FastCGI.pm
lib/Catalyst/Script/Server.pm

index 0029995..f4c3c27 100644 (file)
@@ -55,6 +55,14 @@ has nproc => (
     documentation => 'Specify a number of child processes',
 );
 
+sub _plack_loader_args {
+    my ($self) = shift;
+    return (
+        map { $_ => $self->$_() }
+        qw/pidfile listen manager nproc detach keep_stderr/
+    );
+}
+
 sub _application_args {
     my ($self) = shift;
     return (
index 5b8e3c1..7798c55 100644 (file)
@@ -180,6 +180,15 @@ sub run {
 
 }
 
+sub _plack_loader_args {
+    my ($self) = shift;
+    return (
+        port => $self->port,
+        host => $self->host,
+        keepalive => $self->keepalive ? 100 : 1,
+    );
+}
+
 sub _application_args {
     my ($self) = shift;
     return (