i found some questions and answers on mailing lists but there is still a
problem - when i want to create new worker from within a worker -
::BackgrounDRb::MiddleMan.new_worker(:class => :second_worker, :args =>
{:id=>2, :text=>"slave"}) works
but when i want to get reference to that object:
::BackgrounDRb::MiddleMan.worker(@second)
yields:
NoMethodError: undefined method `worker'' for
BackgrounDRb::MiddleMan:Class
from (drbunix:///tmp/backgroundrbunix_localhost_2999)
(drbunix:///tmp/backgroundrb.8516/first_worker_c6824af92d0ae35bcbba75df4e282
b6f_0_0.158526073008825)
/home/swistak/rails+backgroundrb/lib/workers/first_worker.rb:26:in
`get_second_ref''
from (irb):223
from :0
> ::BackgrounDRb::MiddleMan.worker(@second) > > yields: > > NoMethodError: undefined method `worker'' for BackgrounDRb::MiddleMan:Class > from (drbunix:///tmp/backgroundrbunix_localhost_2999) > (drbunix:///tmp/backgroundrb.8516/first_worker_c6824af92d0ae35bcbba75df4e282 > b6f_0_0.158526073008825) > /home/swistak/rails+backgroundrb/lib/workers/first_worker.rb:26:in > `get_second_ref'' > from (irb):223 > from :0This is kind of a legacy problem, given that we''ve used the MiddleMan constant on the Rails side to represent the MiddleMan _instance_ rather than the class. ''worker'' is an instance method, so you would have to: MiddleMan.instance.worker(@second) /skaar -- ---------------------------------------------------------------------- |\|\ where in the | s_u_b_s_t_r_u_c_t_i_o_n | | >=========== W.A.S.T.E. | genarratologies |/|/ (_) is the wisdom | skaar at waste.org ----------------------------------------------------------------------