Problem to execute "sidecar" Perl scripts when compiling POE::Component::Resolver with PAR

2011-05-17 Thread Markus Jansen
Hi,

I have a problem when trying to run a PAR (1.002, ~::Packer 1.009) compiled 
executable
which uses POE 1.311 and POE::Component::Client::HTTP 0.943, which uses 
POE::Coponent::Client::Keepalive 0.267,
which finally uses POE::Component::Resolver 0.912.

In short. the problem occurs when Resolver.pm tries to instantiate wheels with
Program  => (
($^O eq "MSWin32")
? \&POE::Component::Resolver::Sidecar::main
: [
$^X,
(map { "-I$_" } @INC),
'-MPOE::Component::Resolver::Sidecar',
'-e',

'POE::Component::Resolver::Sidecar->main()'
]
),

In other words, to keep the executable footprint low (lower than just a fork), 
the code tries to run $^X (which is set to "perl" ...),
but then of course ends up with an arbitrary variety of failures.

IMHO it should be possible to use the Windows "solution" also in the PAR case, 
but given a decent large executable
the question is whether there would be any chance for the "cheap sidecar" 
solution Rocco has intented.

If possible, a solution should avoid the PAR unpack overhead (that is, start 
directly from within $ENV{PAR_TEMP}
and execute the code (a la pp --reusable), but we might also have a (security) 
clash with option -e ...

Another but smaller problem is that I have not seen an easy way to tell 
POE::Component::Resolver all the way down
from POE::Compoent::Client::HTTP that I would like to see less than 8 
subprocesses for the resolver job.

Any hints appreciated.

Best regards,
Markus




Markus Jansen

Ericsson GmbH
Eurolab R&D
Ericsson Allee 1
52134 Herzogenrath, Germany
Phone +49 2407 575 5157
Fax +49 22407 575 150
Mobile +49 172 2742003
markus.jan...@ericsson.com
www.ericsson.com



Ericsson GmbH. Sitz: Düsseldorf. Registergericht: Amtsgericht Düsseldorf, HRB 
33012. Geschäftsführer: Stefan Koetz (Vors.), Nils de Baar, Bernd Schmidt. 
Aufsichtsratsvorsitzender: Anders Runevad.

This Communication is confidential. We only send and receive email on the basis 
of the terms set out at 
www.ericsson.com/email_disclaimer.



<><>

Re: Problem to execute "sidecar" Perl scripts when compiling POE::Component::Resolver with PAR

2011-05-18 Thread Rocco Caputo
On May 17, 2011, at 11:48, Markus Jansen wrote:
>  
> Another but smaller problem is that I have not seen an easy way to tell 
> POE::Component::Resolver all the way down
> from POE::Compoent::Client::HTTP that I would like to see less than 8 
> subprocesses for the resolver job.

Hi, Markus.

The entire POE::Component::Client::HTTP stack is customizable by configuring 
your own objects and passing them in, but it looks like I've forgotten to 
document everything.

Something like this should work:

POE::Component::Client::HTTP->spawn(
  ConnectionManager => POE::Component::Client::Keepalive->new(
resolver => POE::Component::Resolver->new(
  max_resolvers => 2,
)
  )
);

-- 
Rocco Caputo