Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Dev

Setting the port in the configuration

 

 

Catalyst dev RSS feed   Index | Next | Previous | View Threaded


domm at cpan

Sep 8, 2008, 1:47 PM

Post #1 of 2 (1045 views)
Permalink
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$_.$/}
Attachments: port_in_config.Catalyst-Runtime-5.70.patch (0.50 KB)
  port_in_config.Catalyst-Devel-1.00.patch (1.00 KB)


domm at cpan

Oct 1, 2008, 12:19 PM

Post #2 of 2 (868 views)
Permalink
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 [at] lists
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev

Catalyst dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.