Fred and Jeff: thanks a lot I got it to "work".

Thing is… I ran some tests and concurrency is in fact a big problem:
my background workers all need to read and write from/to the session
data. I was thinking that using a lock would help (each process would
have to wait for the other to release the data):

ActiveRecord::SessionStore::Session.find(:all, :conditions =>
["session_id = ?", lsession_id], :lock => true)

but I am in fact getting an ActiveRecord::ConnectionTimeoutError (and
yet I am trying to release the session as quickly as possible in each
process).

So I was wondering: is there a recommended design to get several
workers to pass info between each other? Say for example:

- a bunch of workers A do a simple task
- a daemon worker B is "listening"
- each time a process A returns a value, it "sends" it to B
- B accumulates these values

I thought that Workling return store would do the trick but it
doesn't: each time you "set" a value it erases the previous one. I
guess each A could store their return value as a row in a DB - but it
seems to me like an overkill?

For some reason I struggle to find info on this on the web.

Thanks a lot,
Pierre

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to