Pergunta

Is it possible to create a shared LWP::UserAgent object that can be used for HTTP requests in different threads?

Foi útil?

Solução

The short answer is no. There may be a way to use shared mem to achieve this, but even if it were possible, I don't think you'd want to do this because there are objects stored on the user agent itself such as last error etc. If you want to synchronize cookies, you can take care of that by specifying a cookie jar that you persist and reuse ( from perldoc for LWP::UserAgent ):

$ua->cookie_jar( $cookie_jar_obj )

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top