drb question

A

Ara.T.Howard

i never really seem to do more that play with drb and then forget everything,
nonetheless this perplexes me:


~ > cat a.rb
require 'drb/drb'
mode = ARGV.shift || 'server'

case mode
when 'server'
a = ['foobar']
DRb.start_service nil, a
uri = DRb.uri
puts "ruby #{ $0 } client #{ DRb.uri }"
DRb.thread.join
when 'client'
uri = ARGV.shift
DRb.start_service nil, nil
a = DRbObject.new nil, uri
p a.size
p a.unshift
end


~ > ruby a.rb server
ruby a.rb client druby://fortytwo.merseine.nu:1241


~ > ruby a.rb client druby://fortytwo.merseine.nu:1241
1
["foobar"]


~ > ruby a.rb client druby://fortytwo.merseine.nu:1241
1
["foobar"]

it appears that unshift returns the entire array in this case? what it this?
slap me if this is a stupid question.

thanks.

-a
--
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| A flower falls, even though we love it; and a weed grows, even though we do
| not love it. --Dogen
===============================================================================
 
A

Ara.T.Howard

On Thu, 10 Jun 2004, Ara.T.Howard wrote:

i am an idiot. please ignore - composed this late last night and hit send
this morning w/o a review. sorry.

i never really seem to do more that play with drb and then forget everything,
nonetheless this perplexes me:


~ > cat a.rb
require 'drb/drb'
mode = ARGV.shift || 'server'

case mode
when 'server'
a = ['foobar']
DRb.start_service nil, a
uri = DRb.uri
puts "ruby #{ $0 } client #{ DRb.uri }"
DRb.thread.join
when 'client'
uri = ARGV.shift
DRb.start_service nil, nil
a = DRbObject.new nil, uri
p a.size
p a.unshift
end


~ > ruby a.rb server
ruby a.rb client druby://fortytwo.merseine.nu:1241


~ > ruby a.rb client druby://fortytwo.merseine.nu:1241
1
["foobar"]


~ > ruby a.rb client druby://fortytwo.merseine.nu:1241
1
["foobar"]

it appears that unshift returns the entire array in this case? what it this?
slap me if this is a stupid question.

thanks.

-a
--
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| A flower falls, even though we love it; and a weed grows, even though we do
| not love it. --Dogen
===============================================================================

-a
--
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| A flower falls, even though we love it; and a weed grows, even though we do
| not love it. --Dogen
===============================================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

a __real__ drb question 3
drb load limit 3
trying to get drb to work ... 0
drb application in bots 0
DRB class in array 7
portable signals 2
question DRb class definition share or not share 2
DRb and ActiveRecord 3

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,045
Members
48,769
Latest member
Clifft

Latest Threads

Top