Quick DRb question

Hello,

In DRb (or drb, or druby, or… what should I call it?), I’m starting a
server and my Apache/mod_ruby scripts are connecting to it when they need
to.

My question: If two (or more) people connect to my webserver at roughly the
same time, on two different Apache/mod_ruby processes, are their requests
all sent to the same DRb object, one at a time?

In other words, Jack and Jill request different pages. Jack’s page makes
two DRb requests: foo(1)' andbar(1)’. Jill’s page makes two different
requests: foo(2)' andbar(2)’. Do these get sent to different DRb
objects (i.e. does DRb spawn new processes like Apache does?), or are these
all sent to the same object, which may receive any of the following
sequences of messages?

foo(1), bar(1), foo(2), bar(2)
foo(2), bar(2), foo(1), bar(1)
foo(1), foo(2), bar(1), bar(2)
foo(1), foo(2), bar(2), bar(1)
etc.

(but never foo(1), bar(2), bar(1), foo(2))

Chris

They are sent to the same DRb object, and may be processed at the same
time. DRb starts a new thread for handling each incoming request.

You have to serialise the requests yourself, or build your own pool of
objects if that’s how you want them handled. A sample is attached below, if
it’s any use.

Cheers,

Brian.

simplepool.rb (4.68 KB)

···

On Fri, Mar 21, 2003 at 02:41:23AM +0900, Chris Pine wrote:

In DRb (or drb, or druby, or… what should I call it?), I’m starting a
server and my Apache/mod_ruby scripts are connecting to it when they need
to.

My question: If two (or more) people connect to my webserver at roughly the
same time, on two different Apache/mod_ruby processes, are their requests
all sent to the same DRb object, one at a time?