Joel VanderWerf
8/30/2006 10:38:00 PM
Phil Tomson wrote:
...
> #client:
> require 'msgqueue'
> require 'drb'
>
> DRb.start_service()
^^^^^^^^^^^^^^^^^^^
This will request a free port from the OS, so that the client can
respond to requests from the server. (DRb is really pretty symmetrical.)
A request to the client is generated when, for example, the client calls
a method with a block, and the server yields to the block.
...
> So what's with the port number 33135? It's not a port I'm using.
That's just what the OS gave you. If you give the client's start_service
call an explicit URL that you chose, you'd see that there.
> also, is Queue (the one that comes in with require 'thread' ) good for
> this kind of use? It's advertised as being safe for multiple thread
> access, but in this case there are also multiple processes involved as
> well.
Outside processes send their requests into DRb, which starts threads to
process them. So, as far as the Queue is concerned, there are multiple
threads accessing it, but it doesn't know about other processes. So it
should be ok.
--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407