سؤال

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

هل كانت مفيدة؟

المحلول

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 )

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top