# Stopping a specific DRb service

**URL:** <https://www.ruby-forum.com/t/stopping-a-specific-drb-service/189108>\
**Category:** Ruby\
**Created:** [May 24, 2010, 4:59pm UTC](https://www.ruby-forum.com/t/stopping-a-specific-drb-service/189108 "2010-05-24T16:59:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![christoforever](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6de8d8/32.png) [@christoforever](https://www.ruby-forum.com/u/christoforever)\
**Post date:** [May 24, 2010, 4:59pm UTC](https://www.ruby-forum.com/t/stopping-a-specific-drb-service/189108/1 "2010-05-24T16:59:41Z")

</div>

I have a DRb service which in turn spawns off multiple threads. Each of  
these threads interacts with other DRb services on different machines.  
To interact with these other DRb services I of course do something to  
the effect of

DRb.start\_service  
status = DRbObject.new\_with\_uri(blah blah blah)

So far I’ve just let the method finish which calls these external DRb  
services. However this does not close the connection with them. The  
method itself finishes but the connection is still live. If I attempt to  
do DRb.stop\_service it kills the main program altogether. Is there a way  
I can close that specific connection with killing the main executing  
program?

---

<div class="post-metadata">

**Author:** ![christoforever](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6de8d8/32.png) [@christoforever](https://www.ruby-forum.com/u/christoforever)\
**Post date:** [May 25, 2010, 1:53am UTC](https://www.ruby-forum.com/t/stopping-a-specific-drb-service/189108/2 "2010-05-25T01:53:10Z")

</div>

Christopher Dancy wrote:

> I have a DRb service which in turn spawns off multiple threads. Each of  
> these threads interacts with other DRb services on different machines.  
> To interact with these other DRb services I of course do something to  
> the effect of
> 
> DRb.start\_service  
> status = DRbObject.new\_with\_uri(blah blah blah)
> 
> So far I’ve just let the method finish which calls these external DRb  
> services. However this does not close the connection with them. The  
> method itself finishes but the connection is still live. If I attempt to  
> do DRb.stop\_service it kills the main program altogether. Is there a way  
> I can close that specific connection with killing the main executing  
> program?

SOLVED. I was under the impression ( not sure which site at the moment  
gave me the idea ) that in order to communicate with a DRb service the  
calling thread had to do something like “DRb.start\_service” for just  
issuing a command. If I had read the actual DRbServer Documentation  
earlier I might have avoided this problem. Requiring ‘drb’ and doing  
something like “status = DRbObject.new\_with\_uri(host:port).get\_status”  
worked just fine. Just an FYI in case anyone comes across this same  
problem.
