perl-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: [PATCH] @NextAvailablePort@ token in
Date Thu, 27 Oct 2005 00:03:25 GMT
Geoffrey Young wrote:
>>SetVar MyPortFoo @NextAvailablePort@
>>What do you think?
> sounds like a good idea

The reason I was hesitating about going ahead with it, is that I'd love to 
have a way to figure out what was that port number at run time (unless the 
directive took care of it). e.g. with vhost we can get the port number by 
supplying the vhost's name. But I couldn't think of a similar way for this 
feature. May be it could be something like:

   SetVar MyPortFoo @NextAvailablePort:foo_port@

and have Apache::Test store that info, and let for example the client side 
access that info by passing foo_port as an identifier?

>>+       if ($key eq 'nextavailableport') {
>>+           $self->server->select_next_port;
>>+       }
> rather than hard-coding an exception, maybe use some type of coderef map?
> my $non_var_tokens = {
>   nextavailableport => $self->server->can('select_next_port'),
> };
> or somesuch?


> but +1 on whatever you come up with - this is goodness :)


Stas Bekman
MailChannels: Assured Messaging(TM)
The "Practical mod_perl" book

View raw message