From: Robert Klemme Date: 2008-06-30T20:05:16+09:00 Subject: Re: Why can't I return "Threads.list" Array in DRb? 2008/6/29 Iņaki Baz Castillo : > Hi, I can't understand why I can't return the current "Threads.list" array in > a DRb server method. > > - In the DRb server object I just do: > > def current_threads > Thread.list > end > > - And the DRb client calls: > > drb_client.current_threads > > but instead of an Array object I get a DRb::DRbObject, and in each call to > this method I get a different "id": > > irb> drb_client.current_threads > => # > irb> drb_client.current_threads > => # > > Of course, I'm 100% sure that "Thread.list" returns an Array. If I return any > other Array all works ok: > > - DRb server: > > def current_threads > [1,2,3,4,5] > end > > irb> drb_client.current_threads > [1,2,3,4,5] > > > Why does this issue occur when returning "Thread.list"? Threads are local to a process so it does not make any sense to transfer them to another process. What are you trying to achieve? Cheers robert -- use.inject do |as, often| as.you_can - without end