Displaying 7 results from an estimated 7 matches for "workerproxy".
2008 Mar 25
1
extending bdrb / running multiple servers
...oing a lot easier with  
the new version, except for one catch.  With the old backgroundrb, I  
was able to connect to an arbitrary server like this:
thisMiddleMan = DRbObject.new(nil, "druby://#{server_name}:22223");
Now this doesn''t work.  So, I took a look at  
BackgrounDRb::WorkerProxy, and it seems like it can only connect to  
the server listed in the config file.  Is there supposed to be a way  
to manage multiple backgroundrb servers?  I''ve read the manual, it''s  
not in there.  My solution so far is to subclass WorkerProxy, with a  
new init method that tak...
2007 Apr 26
2
looking for a worker that''s gone
...s/ 
brandon/projects/backgroundrb/vendor/plugins/backgroundrb/server/lib/ 
backgroundrb/middleman.rb:396:in `worker''
I''ve modified MiddleMan#worker to return nil if the job doesn''t exist:
     def worker(key)
       worker = ex { @jobs[key].object if @jobs[key] }
       WorkerProxy.new(worker) unless worker.nil?
     end
What do you think?
Brandon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://rubyforge.org/pipermail/backgro...
2007 Oct 31
4
How you want BackgrounDrb to behave
...so implement
this method
  # if you want to trigger your workers from rails.
  def receive_internal_data p_data
    self.send(p_data[:method],p_data[:data])
  end
  def send_mail data
  end
end
And you can invoke a method in worker from rails using:
# invoke method send_mail in newsletter_worker
WorkerProxy.send_request(:worker => :newsletter_worker, :method =>
:send_mail, :data => @newsletter.id)
# No Kidding, guys above code works.
Also, as usual you define your workers in a worker directory and they
will be picked and run.
Now, It should be noted that, part of stability that comes to new...
2008 Jun 10
3
Backgroundrb fixes for transfering large amounts of data
...ate = 0
          @length_string = ""
          @numeric_length = 0
          extract(remaining,&extracter_block)
        end
      end
The second problem we hit was ask_status repeatedly returning nil.  The
root cause of this problem is in the read_object method of the
BackgrounDRb::WorkerProxy class when a data record is large enough to
cause connection.read_nonblock to throw the Errno::EAGAIN exception
multiple times.  We changed the code to make sure read_nonblock is
called repeatedly until the tokenizer finds a complete record, and this
fixed the problem.
  def read_object
    begin...
2008 Jun 06
1
Unexpected NameError when invoking task on worker
...ng the console to invoke the
worker, but run into this problem, and not sure what is going on:
[d96440a6 at d96440a6 ~/testapp]$ script/backgroundrb start
[d96440a6 at d96440a6 ~/testapp]$ ruby script/console
Loading development environment (Rails 2.0.2)
>> MiddleMan
=> #<BackgrounDRb::WorkerProxy:0x8675b6c @mutex=#<Mutex:0x8675b44>>
>> worker = MiddleMan.worker(:basic_worker)
=> #<BackgrounDRb::RailsWorkerProxy:0x995f78c @job_key=nil,
@middle_man=#<BackgrounDRb::WorkerProxy:0x8675b6c
@mutex=#<Mutex:0x8675b44>>, @worker_name=:basic_worker>
>> worker....
2008 Mar 31
0
Patch - Multiple servers support
Hi,
This is a patch that allows you to work with multiple backgroundrb  
servers from within Rails.  It modifies the rails worker proxy to use  
a middleman supplied in its constructor, instead of using the  
MiddleMan constant.  Basically a fix to make  
BackgrounDRb::WorkerProxy.custom_connection usable (without patch,  
you can establish a custom connection but all calls to worker objects  
still go to the main MiddleMan connection regardless).
If I didn''t submit this correctly please let me know, I don''t submit  
patches all that often. Thanks.
--
Ste...
2007 Jan 04
10
Intermittent "can''t convert Float into Hash" and results.rb
Hi,
I''m using backgroundrb 0.2.1 in a production environment and for most 
parts I''m very happy.  We are using it to do some heavy video editing on 
the server side and it works great except that under, what seems heavy 
load the below problem happens intermittently.
The problem has only happened 5 times out of over 500 runs by our 
backgroundrb worker.
This is the code in our