[Backgroundrb-devel] 1) Error 2) sending request to a specific worker

Christopher Haupt chaupt at mobirobo.com
Sun Dec 16 22:52:46 EST 2007


Hi Hemant, all:

Good work to-date on the new bdrb.

On Dec 15, 2007, at 9:30 PM, hemant wrote:

> On Dec 16, 2007 4:42 AM, Mickael Faivre-Macon <faivrem at gmail.com>  
> wrote:
>>
>>
>> Is that the right way of doing things ?
>> How would you do it ?
>
> I am cooking a smallish worker with detailed explanation on how to
> handle multiple XMPP clients from one instance of backgroundrb.
>

I've been developing a chat middle-ware solution for a client  
(bunnybot.com). This is a the approach I've taken. We make heavy use  
of XMPP/Jabber, run OpenFire on the back-end, and need to be able to  
maintain user presence information. I've created a light-weight client  
worker that manages pools of user proxy objects inspired by xmpp4r- 
simple. Using this approach, a single worker can scale to maintain a  
pretty good size collection of connections (I've tested with 100's,  
don't see why it couldn't be more pretty much limited to OS  
resources). The worker and the app communicate in the standard way,  
with simple keys that identify the instance of the proxy object, and  
serialize key data (e.g. rosters, presence updates, messages, etc).  
I've got a few more things to do on the implementation, being paused  
while finishing other deployments, but am happy to discuss.

I had the first version of this running under the older bdrb code-base  
using a self-managed set of threads. I'm moving it to the HEAD and  
looking at the new tcp connections in the event loop Hemant mentions.

If others are doing similar things and can share knowledge, gotchas,  
or even code, that would be cool. A few of us have exchanged some  
messages over at RailsForum and RubyOnRails-Talk, so check those  
places for other leads.

-chris

--
Christopher Haupt
chaupt at mobirobo.com





More information about the Backgroundrb-devel mailing list