Mailing List Archive

Setting the port in the configuration
Hi!

As we have some cat apps running that need to talk to each other, we'd
love to start them on the same port, even if we forget the --port flag
to ourapp_server.pl

After a very short conversation on IRC, I hacked together these two
patches.

port_in_config.Catalyst-Runtime-5.70.patch changes
Catalyst::Engine::HTTP to use the port defined in the 'Engine::Server'
config section. The problem with this approach is that one cannot
override the configured port from the commandline or environment.

port_in_config.Catalyst-Devel-1.00.patch changes lib/Catalyst/Helper.pm
(or rather the appname_server.pl script) to add a check for the config
item when trying to figure out the port.

I like port_in_config.Catalyst-Devel-1.00.patch a bit more, even though
it makes it necessary to regenerate the _server.pl script for all apps
that want the functionality.

What do you think?

Any chances that one of these patches will be applied? Or would you
rather want patches for the devel versions (5.80/1.10) ?


--
#!/usr/bin/perl http://domm.plix.at
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}
Re: Setting the port in the configuration [ In reply to ]
Hi!

On Wed, Oct 01, 2008 at 10:28:21AM -0400, Andy Grundman wrote:

>> As we have some cat apps running that need to talk to each other, we'd
>> love to start them on the same port, even if we forget the --port flag
>> to ourapp_server.pl
>
> Would it not be easier to just set the CATALYST_PORT environment variable
> in ~/.profile or similar?

Not really, at least not when you have to set it on several machines (eg
we have 4 developer machines, two more laptops, devel, stage and live)

Setting it in myapp.conf (and/or myapp_local.conf) is much less
hassle...


--
#!/usr/bin/perl http://domm.plix.at
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev