0

I'm working on an application, but at the moment I'm stuck on multithreading with rails.

I have the following situation: when some action occurs (it could be after a user clicks a button or when a scheduled task fires off), I'm starting a separate thread which parses some websites until the moment when I have to receive the SMS-code to continue parsing. At this moment I make Thread.stop.

The SMS-code comes as a POST request to some of my controllers. So I want to pass it to my stopped thread and continue its job.

But how can I access that thread?

Where is the best place to keep a link to that thread?

So how can I handle multithreading? There may be a situation when there'll be a lot of threads and a lot of SMS requests, and I need to somehow correlate them.

4

1 に答える 1