BackgrounDRb behavoir

S

Sy Ys

Call me confused. I call the following:

MiddleMan.schedule_worker(
:class => :update_friends_worker,
:job_key => :schedule_test,
:worker_method => :arg_method,
:worker_method_args => "my argument to arg_method",
:trigger_type => :cron_trigger,
:trigger_args => "1 * * * * * *"
)

And that worker looks like:

class UpdateFriendsWorker < BackgrounDRb::Worker::RailsBase

def do_work(args)
logger.info('Shoes')
end

end
UpdateFriendsWorker.register

Shouldn't the above put an entry 'Shoes' in the log every minute? I only
get 1, and that's it. Been waiting 5 minutes.

-Steve
 
E

Ezra Zygmuntowicz

Call me confused. I call the following:

MiddleMan.schedule_worker(
:class => :update_friends_worker,
:job_key => :schedule_test,
:worker_method => :arg_method,

^^^^^^^^^^

The method that will be called by the scheduler is :arg_method since
thats how you defined it. The do_work method always gets called once
on worker instantiation. the :worker_method is the method that will
be called by the scheduler.
:worker_method_args => "my argument to arg_method",
:trigger_type => :cron_trigger,
:trigger_args => "1 * * * * * *"
)

And that worker looks like:

class UpdateFriendsWorker < BackgrounDRb::Worker::RailsBase

def do_work(args)
logger.info('Shoes')
end

def arg_method
logger.info('UrMom')
end
end
UpdateFriendsWorker.register

Shouldn't the above put an entry 'Shoes' in the log every minute? I
only
get 1, and that's it. Been waiting 5 minutes.

-Steve


Cheers-
-- Ezra Zygmuntowicz
-- Lead Rails Evangelist
-- (e-mail address removed)
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top