Akdeniz / google-play-crawler

Play with Google Play API :)
Other
562 stars 204 forks source link

How to use library in multithreaded mode? #51

Open jaturken opened 10 years ago

jaturken commented 10 years ago

I need Google Play data(for example, reviews) in multiple localizations. I want to parse reviews in multiple threads, so in each thread I

When runned in one thread, code works perfectly, but problems appears in multithreaded mode - reviews are requested from incorrect locale. I don't want to synchronize these two actions by mutex or smth else - it destroys the idea of using threads. There was an idea about cloning instance of GooglePlayAPI object for each thread, but it is unclonable.

How can I use library in multithreaded mode? Am I missing something? Maybe it's possible to set localization for each request?

My environment: jruby, sidekiq as threads manager. Yep, I use library from ruby.