RubyConf 2006 Lightning Talk
2006-10-21 @ 12:02Here’s the code for my lightning talk. First my drb session:
irb(main):001:0> DRbObject.new_with_uri("druby://localhost:9000").write('the best!', 'green')
=> 1
irb(main):002:0>
~~~
The Rails controller: ~~~ ruby require ‘drb’
class BetaBriteController < ApplicationController def index if params[:q] Thread.new(params[:q], params[:c]) { |q,c| obj = DRbObject.new_with_uri(“druby://localhost:9000”) obj.write(q, c || ‘red’) } end end end ~~~