Displaying 20 results from an estimated 12000 matches similar to: "Passing blocks to a worker"
2006 Sep 08
1
Access worker outside of Rails?
Hi all,
Wondering if it''s possible to access a worker from outside of Rails -- I''ve
tried simply including:
require RAILS_ROOT + ''/vendor/plugins/backgroundrb/backgroundrb.rb''
BackgrounDRb.MiddleMan.get_worker(key)
but, I get an error that the ''get_worker'' method is undefined. Any ideas?
Thanks a lot,
W
-------------- next part
2006 Dec 01
2
passing arguments to worker method
Hello all,
i just started using backgroundrb and i really like it a lot so far.
I finally succeeded in setting up version 0.21 and the examples from the
readme run fine.
Now i do not want to create and delete my worker anytime i want it to do
something but call repeatedly a method with arguments.
There is a arg_method defined in the readme so i guess this is a feasible
way to procede.
2006 Feb 10
1
instance_eval and Proc objects
Hi All,
Got a bit of a Ruby question for you.
If I have a function that makes a proc object like this:
def select(selector, &proc)
el = Element.new
el.instance_eval proc
end
select("#thing") do
hide
end
Wat I want to do is evaluate the Proc in the context of el but this
doesn''t work because instance_eval accepts a string or a block and not
a Proc object. I sense
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 Mar 08
0
worker cant delete?
Hi,
I get the following error from my client program when I try to call delete
after my worker is completed:
goten at goten-server:~/projects/svn_working/m29svn_back/app$ ruby
backup_app.rb {:done=>true, :txt=>["piping to tmp", "piping done",
"getting youngest", "youngest got", "destfile
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''
2007 May 31
0
background worker just stops running after some time
Hi,
I am fairly new to ruby/rails, but I thought I did a fair job of setting up
my background worker, but after some time, maybe 4-5 hours of running, it
just stops running, without any messages. Here is the yml file:
backgroundrb.yml
---
:port: 2000
:rails_env: production
:host: localhost
here is my schedules file:
alerts_task:
:class: :alerts_worker
:job_key: :alerts_key
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
2007 May 26
0
New worker not being created
I figured out that in the backgroundrb.yml, I had the old setting of making
the database RAILS_ENV. It wasn''t a valid variable in backgroundrb 0.2.1,
and it wasn''t reporting an error, so I had no idea. Once I changed it to
''development'' or ''production'', it started working.
I found that if a worker has an error, it usually logs the error
2006 Nov 11
0
Error when creating a new worker -- "Text is not a module - (TypeError)"
Hello everyone,
I''m stuck with this very obscure error whenever I try to create a new
worker. My worker is a subclass of BackgrounDRb::Worker::RailsBase, and if
you follow the stack trace below, you can tell that the error occurs while
trying to load Rails. There is no problem starting up the server, by the
way. Does anyone have any idea what might be causing this? I didn''t have
2008 May 29
0
How to know the environment (development/test/production) inside a worker - FIXED
Hi Guys,Looks like I have to do this in backgroundrb.yml
:backgroundrb:
:ip: 0.0.0.0
:production:
:backgroundrb:
:port: 11008 # use port 11008
:environment: production
That is, have an entry for "environment: production" under :production:,
This seems to have fixed the issue.
Regards
Sarat
On 5/29/08, Sarat Kongara <saratkongara at gmail.com> wrote:
>
>
2007 Jan 23
0
Error while creating one worker from another
for some strange reason this error occours when i create one worker from
another BUT only when i derive worker class from Worker::Base instead or
Worker::RailsBase - when change it back it works fine, child worker can
have empty do_work, but this error still ocours
Bad file descriptor (Errno::EBADF)
/var/lib/gems/1.8/gems/slave-1.2.0/lib/slave.rb:214:in `for_fd''
2008 May 21
2
How to know the environment (development/test/production) inside a worker
Hi Guys,You can start backgroundRb in different environments using -e
option.
./script/backgroundrb -e production
I like to run a rake task from my worker - something like rake
RAILS_ENV=proper_environment thinking_sphinx:start
I am not sure how to figure out the environment with which the backgroundRb
is started from inside a worker task. Any help is appreciated. Thanks for
your time.
Regards
2006 Jun 30
0
Fwd: Need to send email from a worker
Begin forwarded message:
> From: Ezra Zygmuntowicz <ez at brainspl.at>
> Date: June 29, 2006 8:18:10 PM PDT
> To: Douglass Turner <douglass.turner at gmail.com>
> Subject: Re: [Backgroundrb-devel] Need to send email from a worker
>
>
> On Jun 29, 2006, at 7:45 PM, Douglass Turner wrote:
>
>> Hello,
>>
>> Can someone suggest the simplest way to
2007 Dec 18
1
Backgroundrb crash calling ask_status when worker not running
When I call ask_status on a worker that has not been started I get and
exception of type BackgrounDRb::BdrbConnError, which is fine. I can deal
with that, but I also find that the backgroundrb process dies as well.
The scenario is simple: Call ask_status on a worker that is not auto
loaded. I used a job_key, in case that makes a difference.
-------------- next part --------------
An
2007 Apr 26
2
looking for a worker that''s gone
In my app, I store the job key when a worker is fired off and then
check back in periodically to see how its doing. The workers delete
themselves when they''re done. I would expect when I try to get a
worker that has been deleted, I would get nil or a proper exception,
but instead I get:
>> MiddleMan.worker(''foobar'')
NoMethodError: undefined method
2007 Apr 24
0
Bug in Rails worker creation through scheduler
Hi Folks!
A small bug in the Scheduler code caused a small nightmare for me
over the last hours. The symptoms were that my scheduled worker
(Rails-based) wouldn''t start. Nothing in the log files, no errors on
the console, no hints whatsoever about what went wrong. So I filled
up the code with logging statements and tracked down the problem to
line 48 of
2006 Aug 07
2
uninitialized constants in worker class
I am new to this list and relatively new to the backgroundrb plugin,. So
first i will say hello to everybody here, especially to Ezra
Zygmuntowicz!
I played a little bit with a dummy worker and so far everything worked
well.
But now i want to do real work in a worker but now i get that error[1].
It looks like that the constants configured in environment* configs are
not available to the worker
2008 Apr 10
1
Communicating Worker-to-Worker
Hi everyone,
I have two workers, a connection_worker and an interface_worker, that I want
to be able to call methods on each other. Initially I thought I could do
this:
connection_worker
def alive?
return true
end
end
interface_worker
def test_connection
if MiddleMan.worker(:connection_worker).alive?(true)
return true
end
end
end
Obviously this is a somewhat contrived
2006 Nov 21
1
rendering from within a worker
I''m using backgroundrb for its scheduled jobs.
Now, a job that runs on a daily basis creates an xml file that I
currently create with an .rxml template.
Can I run a controller action from within a worker ? Can I render() a
template from within a worker ?
Sorry, I haven''t grasped the whole rails/backgroundrb relationship so
I don''t know what I can and not do.
Thanks