Displaying 20 results from an estimated 2000 matches similar to: "How to get result from do_work in a worker"
2007 Dec 11
2
Mongrel not starting: `initialize_without_backlog'': Cannot assign requested address - bind(2) (Errno::EADDRNOTAVAIL)
Hi
I have a rather strange problem with mongrel and I would be grateful if
anyone could assist me with resolving.
I have an application running mongrel 1.1.1 and rails 1.2.5 with ruby 1.8.6.
It was all working fine and starting as expected. But I did a server reboot
once and mongrel has refused to start up since. I get the following error:
2006 Jul 19
1
Testing worker classes
Hi,
Does it make sense to test a worker class by calling
Middleman.new_worker? Or should I just be testing the functionality in
the do_work method, with, say, a mock object. This seems like a really
ugly DRY violation: you''d need to keep the code in the mock and the
real worker in sync.
That''s the philosophical half of my question. In fact, until someone
tells me why I
2007 Dec 13
4
Weird Mongrel error: Not starting.
Hi list,
I have a problem with Mongrel which is really bugging me. I would really
appreciate any help that anyone can provide to help me in solving this
problem.
1. My setup:
Apache front_end with mod_proxy_balancer in front of 4 mongrel/rails
instances of my application.
Rails 1.2.5
Ruby 1.8.6
Mongrel 1.1.1
2. I noticed that the CPU consumption on my server was 100% being consumed
by ruby so I
2006 Oct 17
2
accessing args in worker
If, in the controller, I start a worker and pass in an argument like this:
session[:job_key] = MiddleMan.new_worker(:class => :foo_worker,
:args => {:emrec_id => @emrec.id})
How do I access the value in the worker? I can''t seem to figure it out ;-p
Thanks!
Bill
-------------- next part --------------
An HTML attachment was
2006 Dec 03
0
worker is not executed
Hey,
I''ve got a problem where my worker is not being properly executed....
it used to work in an earlier version of brb, but i realized my
vendor/plugins was out of whack, upgraded to the newer schedule-
oriented release (0.2.1). I can start brb, and run the new_worker
middleman, but ntohing happens.
When putting brb in ''run'' mode, i see this:
undefined method
2007 Feb 22
1
failed to find slave socket - (RuntimeError)
Hi everyone,
I''ve a class that try to spawn two workers, every 5 seconds.
The code is something like:
while true do
MiddleMan.new_worker(:class => :researches_worker,:job_key
=> :researches)
MiddleMan.new_worker(:class => :products_worker,:job_key => :products)
sleep(5)
end
I''m using ":job_key", so if a worker hasn''t already ended its work
2007 May 22
4
Recommendations for eternally-running backgroundrb workers?
I''ve got some workers that I want to have running all the time. Right
now I''m just launching them manually, by requesting a special page in
my rails app that includes lines like:
MiddleMan.new_worker(:class=> :receiver, :job_key=>:r,
:args=>{:sleep_time=>10})
This strikes me as a really weak way to fire up my workers. I
basically want to automate things so
2006 Sep 05
2
question about passing array of AR objects to worker
got a wierd problem maybe someone can help with.
whenever i try to pass an array or AR objects to my worker, i end up
with a DRb object in the worker...here''s an example
class SearchWorker < BackgrounDRb::Rails
attr_reader :resources
def do_work(resources)
logger.info resources.inspect
end
end
class SearchController < ApplicationController
def start_search
2006 Jun 28
1
How to add some process control...
Hi,
First off, thanks Ezra for showing the way with BackgrounDrb. It''s a
real godsend.
I wanted to add a bit of job control to the system so that I could
cancel DRB processes and so on. I thought I''d share how I did it in case
anyone should find it useful or have feedback.
I wanted to be able to put checkpoints into the drb job so that I could
let the job do whatever needs to
2008 Jan 17
3
periodic scheduling
I''ve been using backgroundrb since back in March 2007 or so. It''s
been working mostly OK for me, but since the old version doesn''t seem
to work out of the box with rails 2.0 for me, I decided to test out
the latest version.
So, I''m looking at the scheduling, and trying to figure out the best
option for what I want to do. What I have is a set of workers that
2008 Apr 02
2
scheduling worker methods in rails
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
i''m trying desperately to schedule some worker methods within rails 2.0.2. The
problem is, both methods don''t even get called by BackgrounDRb.
my background.yml:
> ---
> :backgroundrb:
> :port: 11006
> :ip: 0.0.0.0
> ---
> :schedules:
> :server_worker:
> :update:
> :trigger_args: 1 *
2008 May 28
1
nil.send_request = Incorrect worker name?
Hi,
Would greatly appreciate some help with this.
Is the following error caused by an incorrect worker name?
You have a nil object when you didn''t expect it!
The error occurred while evaluating nil.send_request
/usr/lib/ruby/gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:44:in `ask_worker''
Here''s what I''m doing in my rails console.
2006 Jul 10
2
''uninitialized constant'' error
Hi All,
I am fairly new to Ruby and backgroundRB. I am trying to run a simple example in Windows to get my feet wet with backgroundRB and am running into an ''uninitialized constant'' error when I invoke the controller on my rails app.
In ''MyTest'' Controller
-------------------
def longrun
session[:job_key] = MiddleMan.new_worker(:class =>
2006 Jul 03
6
Req: Workers as singletons
Hi,
it would be nice to be able to specify workers as singletons. By this
I mean that every call to the new_worker method returns the same
instance of said worker. This can be done transparently either by
adding a new argument to new_worker (something like :singleton =>
true) or adding a new method, like I did in my installation of
BackgrounDrb:
def get_worker_by_class(klass)
2007 Sep 24
3
Trouble using backgroundrb
Hi all,
I''m a newbie to backgroundrb and am having trouble integrating it into
my rails-app. I''m using namespaces to differentiate between the parts of
my app.
When I want to create a new worker, it seems that it cannot find the
worker object. Here''s my code:
-------------------- controller app/passwd/index --------------------
class Passwd::IndexController <
2008 Mar 19
2
problem with worker status
Hi,
I have a page were users can start jobs that may take several hours to
run. BackgrounDrb is perfect for me and seems to be working well most of
the time but some times I have the following problem:
My worker is set up like this:
class UploadWorker < BackgrounDRb::MetaWorker
set_worker_name :upload_worker
set_no_auto_load(true)
def create(args = nil )
file = args[:file]
2006 Jul 19
1
A couple of problems
Hi Ezra,
Thanks for the great work on BackgrounDRb. I have come across a
couple of problems.
1. I wanted to define a simple class in the worker file to wrap up and
pass back some data to my controller. It seems that if I create the
class either inside or outside of my worker class (in the same file)
it gets wrapper by a DRb::DRbUknown object and therefore cannot be
accessed from my controller.
2007 Dec 17
7
Get "some read error" on calls to worker
I''m running the latest from svn (rev 285). I''ve been having a problem
launching a process repeatedly. What happens is that I get a debug
message "some read error" and then the worker refuses to run again.
I''ve stripped my worker down to just doing a puts and it still happens.
Like the other threads I want to launch my workers as needed, however I
get the
2006 Dec 01
0
Worker won''t start work
(Sorry my last email had the wrong subject)
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''
2008 Jan 22
9
Cannot connect when spawning new workers on demand
Hi!
I''m using the latest&greatest backgroundrb with rails 2.0.2 on ubuntu
dapper.
I''ve made an app that lets you run a query on several servers at once,
which are selected at runtime. Therefore, for each server that is
selected, I spawn a new worker and assign its work.
After everything is completed, the workers are deleted.
I often get this error: