[Backgroundrb-devel] how about the global data when multiple backgroundrbs ?
awatercn at gmail.com
Fri Sep 22 00:22:28 EDT 2006
Suppose a chatroom application, a RailsApp + 2 backgroundrbs: MiddleMan1&
MiddleMan2, running in 2 machines.
When Chater1 login, RailsApp call MiddleMan1 to get something about
Chater1 from db to memory, like his contacts or other personal settings.
When Chater2 login, RailsApp call MiddleMan2 do the same thing.
But who is reponsible for the Global Data? like a Online Chaters List, or
Active Chat Room List ?
I think, for the MiddleMan1 & MiddleMan2 located in different machines,
global data should not be there.
So global data in RailsApp as Global Variables? But how about RailsApp
also running in 2+ servers ?
It seems the possible ways to store global data is db or network file
Hope for suggestions, thanks.
>>On Sep 21, 2006, at 5:44 AM, sherwin velasco wrote:
>> i'm in a team that is currently developing a web 2.0 application that
>> really needs to scale in the very near future.
>> we are using backgroundrb for some of the server tasks.
>> currently, we have two servers (in RubyOnRails) that connects to a
>> single backgroundrb daemon.
>> is there a way that we can run multiple backgroundrb and have the
>> servers do a round robin on them to retrieve a worker using a key that
>> was saved in the session?
>> Backgroundrb-devel mailing list
>> Backgroundrb-devel at rubyforge.org
> Hey Sherwin-
> This could be coded up to work for you. You would basically write a class
that wraps multiple middleman clients and tries to get the workers by
checking for MiddleMan.jobs.keys.include? session [:jobkey] . So you could
have MiddleMan1, MiddleMan2..MiddleManN .
>And just make a wrapper that iterates over each midleman checking to see if
it contains the job you are looking for and using the right middleman.
> This would not be too hard to come up with and I might add something to
support this soon. I do have a completele new version of the whole plugin
cooking. >I hope to get it released this weekend but we shall see. The new
version will support spawning multiple processes and managing those through
the same interface.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Backgroundrb-devel