Open ghost opened 4 years ago
Hey, just bumping this issue. Did you ever figure this out @mengelseatz ?
@PepperTeasdale I haven't and there were no replies. I'm assuming it's thread safe but haven't done a deep dive into the code yet.
It looks like it might not be: we may have accidentally charged $X to one customer that was meant for another customer. And this is the reason I'm here. For some reason, we used an organizer with a few interactions to process the credit card charges. Each charge is processed as an individual Sidekiq job, and multiple jobs can be processed in parallel in the same Ruby process.
Every time I see calls like PayCharge.call(...)
- this always raises a warning: "this is a class method call, need to be careful here"...
I wonder how context
works interactors... is it thread-safe?
Yes, Interactor is thread safe in that you can call .call from multiple threads and each call generates a new context.
However, if you initialize an Interactor (i.e. call .new) then that instance is not thread safe and shouldn't be shared with multiple threads.
I'm looking into using this library but I can't find any info on whether it's threadsafe or not? Thanks for any intel!