Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > BackgrounDRb behavoir

Reply
Thread Tools

BackgrounDRb behavoir

 
 
Sy Ys
Guest
Posts: n/a
 
      05-26-2007
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

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Ezra Zygmuntowicz
Guest
Posts: n/a
 
      05-27-2007

On May 26, 2007, at 4:59 PM, Sy Ys wrote:

> 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
-- http://www.velocityreviews.com/forums/(E-Mail Removed)
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
modify "Close Group" behavoir in X64? MsFriendly Windows 64bit 5 02-28-2008 04:26 PM
modify "Close Group" behavoir in X64? MsFriendly Windows 64bit 0 02-26-2008 08:19 AM
sscanf behavoir Joachim Schmitz C Programming 7 04-20-2007 06:41 AM
Processes with strange behavoir Markus Franz Python 2 04-04-2004 08:29 PM
Strange .avi file behavoir Croos Bustamunky Computer Support 2 02-03-2004 06:54 AM



Advertisments