BackgrounDRb behavoir

Discussion in 'Ruby' started by Sy Ys, May 27, 2007.

  1. Sy Ys

    Sy Ys Guest

    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/.
     
    Sy Ys, May 27, 2007
    #1
    1. Advertising

  2. 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
    --
    -- Engine Yard, Serious Rails Hosting
    -- (866) 518-YARD (9273)
     
    Ezra Zygmuntowicz, May 27, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus Franz

    Processes with strange behavoir

    Markus Franz, Apr 4, 2004, in forum: Python
    Replies:
    2
    Views:
    342
    Peter Otten
    Apr 4, 2004
  2. Joachim Schmitz

    sscanf behavoir

    Joachim Schmitz, Apr 19, 2007, in forum: C Programming
    Replies:
    7
    Views:
    444
    Gunvant Patil
    Apr 20, 2007
  3. Replies:
    5
    Views:
    145
    YANAGAWA Kazuhisa
    Mar 8, 2006
  4. surf

    perl polymorphic behavoir ?

    surf, Feb 7, 2006, in forum: Perl Misc
    Replies:
    3
    Views:
    107
    A. Sinan Unur
    Feb 7, 2006
  5. Daniel Rucareanu

    Weird behavoir while using function aliases

    Daniel Rucareanu, Sep 19, 2006, in forum: Javascript
    Replies:
    22
    Views:
    217
    Richard Cornford
    Sep 25, 2006
Loading...

Share This Page