[Backgroundrb-devel] Noob needs help installing backgroundrb on Windows XP

Chris H chris at etechdata.com.au
Thu Nov 30 23:07:15 EST 2006


I removed my initialize method and it's working as expected :)

this is what I had:

  def initialize(args)
    @running = true
    super(args)
  end
 
  def do_work(args)
    # This method is called in it's own new thread when you
    # call new worker. args is set to :args
   
    while @running
      
       #code went here
     
    end
  end

  now I'ved moved @running = true into do_work.

How come I wasn't able to do what I did with initialize?

Cheers,
chris.

>hmm, do you have your own initialize in your worker class? can you give
>us a skeleton of your worker class?
>
>/skaar
>
>
>* Chris H (chris at etechdata.com.au) [061130 21:38]:
>  
>
>>Hi,
>>
>>I've just installed background rb 0.2.1.
>>
>>When I try start a worker in my application controller I receive the 
>>following error:
>>
>>
>>wrong number of arguments (2 for 1) - (ArgumentError)
>>/home/chris/projects/call_manager/trunk/call_manager_app/vendor/plugins/backgroundrb/server/lib/backgroundrb/middleman.rb:211:in 
>>`initialize'
>>/home/chris/projects/call_manager/trunk/call_manager_app/vendor/plugins/backgroundrb/server/lib/backgroundrb/middleman.rb:211:in 
>>`new_worker'
>>/home/chris/projects/call_manager/trunk/call_manager_app/vendor/plugins/backgroundrb/server/lib/backgroundrb/thread_pool.rb:36:in 
>>`dispatch'
>>/home/chris/projects/call_manager/trunk/call_manager_app/vendor/plugins/backgroundrb/server/lib/backgroundrb/thread_pool.rb:22:in 
>>`dispatch'
>>/home/chris/projects/call_manager/trunk/call_manager_app/vendor/plugins/backgroundrb/server/lib/backgroundrb/middleman.rb:199:in 
>>`new_worker'
>>/usr/local/lib/ruby/1.8/drb/drb.rb:1552:in `perform_without_block'
>>/usr/local/lib/ruby/1.8/drb/drb.rb:1512:in `perform'
>>/usr/local/lib/ruby/1.8/drb/drb.rb:1586:in `main_loop'
>>/usr/local/lib/ruby/1.8/drb/drb.rb:1582:in `main_loop'
>>/usr/local/lib/ruby/1.8/drb/drb.rb:1578:in `main_loop'
>>/usr/local/lib/ruby/1.8/drb/drb.rb:1427:in `run'
>>/usr/local/lib/ruby/1.8/drb/drb.rb:1424:in `run'
>>/usr/local/lib/ruby/1.8/drb/drb.rb:1344:in `initialize'
>>/usr/local/lib/ruby/1.8/drb/drb.rb:1624:in `start_service'
>>/home/chris/projects/call_manager/trunk/call_manager_app/vendor/plugins/backgroundrb/server/lib/backgroundrb_server.rb:315:in 
>>`run'
>>/usr/local/lib/ruby/gems/1.8/gems/daemons-1.0.3/lib/daemons/application.rb:186:in 
>>`start_proc'
>>/usr/local/lib/ruby/gems/1.8/gems/daemons-1.0.3/lib/daemons/application.rb:196:in 
>>`start_proc'
>>/usr/local/lib/ruby/gems/1.8/gems/daemons-1.0.3/lib/daemons/application.rb:226:in 
>>`start'
>>/usr/local/lib/ruby/gems/1.8/gems/daemons-1.0.3/lib/daemons/controller.rb:72:in 
>>`run'
>>/usr/local/lib/ruby/gems/1.8/gems/daemons-1.0.3/lib/daemons.rb:179:in 
>>`run_proc'
>>/usr/local/lib/ruby/gems/1.8/gems/daemons-1.0.3/lib/daemons/cmdline.rb:94:in 
>>`catch_exceptions'
>>/usr/local/lib/ruby/gems/1.8/gems/daemons-1.0.3/lib/daemons.rb:178:in 
>>`run_proc'
>>/home/chris/projects/call_manager/trunk/call_manager_app/vendor/plugins/backgroundrb/server/lib/backgroundrb_server.rb:301:in 
>>`run'
>>
>>
>>I'm running slave (1.1.0) and daemons (1.0.3) as required.
>>
>>I'm starting the worker with:
>>MiddleMan.new_worker(:class => :calls_worker, :job_key => :calls_watcher)
>>
>>thanks in advance!
>>
>>cheers,
>>chris.
>>
>>
>>_______________________________________________
>>Backgroundrb-devel mailing list
>>Backgroundrb-devel at rubyforge.org
>>http://rubyforge.org/mailman/listinfo/backgroundrb-devel
>>    
>>
>
>  
>



More information about the Backgroundrb-devel mailing list