iaintshine / presta_shop

A library for Ruby to interact with the PrestaShop's Web Service API
MIT License
8 stars 11 forks source link

Multithread usage #2

Open nMustaki opened 10 years ago

nMustaki commented 10 years ago

Hi, from what I gather, this gem is not ready for a multithread usage as it is a singleton; do you think it would be a hard work to change it ?

Thanks !

iaintshine commented 10 years ago

Hi,

In a multithreaded environment potential issues that I can think of can occur only during the initialization (all remote server requests are performed using the rest-client gem and internally every time they perform an http request they create a new Net::HTTP instance - and I assume it is thread-safe) . presta_shop gem shares two states between multiple threads - configuration and permissions and I think that it shouldn't require a great amount of work to make them thread-safe. I might have some time during the weekend to look closer and resolve the issue.

Kind Regards, Boguslaw

nMustaki commented 10 years ago

What would be really great, as you know your code better than me :-) Thanks you very much !

/ * "What do you despise? By this you are truly known." \ from Manual of Muad'Dib by the Princess Irulan.

*/

On Thu, Apr 17, 2014 at 9:33 AM, iaintshine notifications@github.comwrote:

Hi,

In a multithreaded environment potential issues that I can think of can occur only during the initialization (all remote server requests are performed using the rest-client gem and internally every time they perform an http request they create a new Net::HTTP instance - and I assume it is thread-safe) . presta_shop gem shares two states between multiple threads - configuration and permissions and I think that it shouldn't require a great amount of work to make them thread-safe. I might have some time during the weekend to look closer and resolve the issue.

Kind Regards, Boguslaw

— Reply to this email directly or view it on GitHubhttps://github.com/iaintshine/presta_shop/issues/2#issuecomment-40688662 .