In the docs, it says:
This module will determine "error_log" in Server::Control, "pid_file" in Server::Control, and "port" in Server::Control from the options hash.
and in the synopsis:
my $starman = Server::Control::Starman->new(
binary_path => '/usr/local/bin/starman'
options => {
port => 123,
error_log => '/path/to/error.log',
pid_file => '/path/to/starman.pid'
},
);
But obviously that needs to be made clearer.
Either you specify the starman options and those are used to populate Server::Control parameters, or you specify Server::Control parameters and those are used to popular starman options. Trying to do it in both directions would be confusing and hard to test all cases (e.g. what if you passed some to starman options and some to Server::Control parameters). So I chose the former.
Maybe 'options' is too generic and needs to be renamed, e.g. 'starman_options'? Then I can say in the docs that "error_log, pid_file, and port will be determined from the starman_options hash". Would that make it clearer?
Jon
On Aug 16, 2012, at 5:22 PM, ron@savage.net.au via RT wrote:
Show quoted text> Queue: Server-Control
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=79010 >
>
> Hi Jonathan
>
> On 16/08/12 21:50, Jonathan Swartz via RT wrote:
>> <URL:
https://rt.cpan.org/Ticket/Display.html?id=79010>
>>
>> Well, right now it auto-generates the Server::Control::Starman parameters based on the starman options. Are you saying you want it to auto-generate the other way too? That sounds complicated. Patches welcome. :)
>
> 1) OK. I can't see where in the docs it says that (hint, hint).
>
> But now there's another problem: When I comment out both bind_addr and
> port, I get an error:
>
> cannot determine port at
> /home/ron/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Server/Control/Starman.pm
> line 57.
>
> Whereas when I only comment out bind_addr, it runs ok (as expected).
>
> But I'm guessing that's because it defaults to localhost (the only case
> I use, so far) and not because it parses the Starman opts. Or is the
> code smarter than I'm thinking :-)?
>
> 2) And yes, I was expecting the code to parse the Server::Control
> options and use them to fill in any necessary in the required Startman
> options.
>
> After all, why should I code that when I can get you to do it for me :-))?
>
> But seriously, if you do it, all end-users will be relieved of that
> effort, which is just duplication.
>
> Cheers
>
>> On Aug 15, 2012, at 9:20 PM, RSAVAGE via RT wrote:
>>
>>> Thu Aug 16 00:20:58 2012: Request 79010 was acted upon.
>>> Transaction: Ticket created by RSAVAGE
>>> Queue: Server-Control
>>> Subject: Could code auto-generate starman options?
>>> Broken in: 0.19
>>> Severity: Normal
>>> Owner: Nobody
>>> Requestors: RSAVAGE@cpan.org
>>> Status: new
>>> Ticket<URL:
https://rt.cpan.org/Ticket/Display.html?id=79010>
>>>
>>>
>>> Hi
>>>
>>> I'd like to see the code auto-generate the starman options:
>>>
>>> options =>
>>> {
>>> listen => '127.0.0.1:5002',
>>> pid => "$pid_file_name",
>>> workers => 1, # OK, Not this one!
>>> },
>>> since the listen and pid values are available already, given:
>>>
>>> my($server) = Server::Control::Starman -> new
>>> (
>>> app_psgi => "$app_path",
>>> binary_path => "$binary_path",
>>> bind_addr => '127.0.0.1',
>>> # error_log => "$error_file_name",
>>> log_dir => "$log_dir_name",
>>> name => 'Local::Application',
>>> options =>
>>> {
>>> listen => '127.0.0.1:5002',
>>> pid => "$pid_file_name",
>>> workers => 1,
>>> },
>>> pid_file => "$pid_file_name",
>>> port => 5002,
>>> server_root => "$app_dir_name",
>>> wait_for_status_secs => 2,
>>> );
>>>
>>
>>
>>
>>
>
>
> --
> Ron Savage
>
http://savage.net.au/
> Ph: 0421 920 622
>