librelist archives

« back to archive

Clockwork & Rails 3 Sidekiq intergration

Clockwork & Rails 3 Sidekiq intergration

From:
John Wong
Date:
2012-09-19 @ 06:42
Hi,

Excellent work on the Sidekiq project. Just a short question.

Any examples of how to use clockwork for Rails 3 and Sidekiq?
The one in the examples folder doesn't seem to help

John

Re: [sidekiq] Clockwork & Rails 3 Sidekiq intergration

From:
Jesse Cooke
Date:
2012-09-19 @ 07:19
On Sep 18, 2012 11:42 PM, "John Wong" <john@flexnode.com> wrote:
>
> Hi,
>
> Excellent work on the Sidekiq project. Just a short question.
>
> Any examples of how to use clockwork for Rails 3 and Sidekiq?
> The one in the examples folder doesn't seem to help
Can you explain what you mean by "doesn't seem to help"

All you should do from clockwork is call perform_async on your worker class.
>
> John

Re: [sidekiq] Clockwork & Rails 3 Sidekiq intergration

From:
John Wong
Date:
2012-09-19 @ 07:56
Hi Jesse,

Sorry for the vague explanation ...

Is there some guidelines on production server setup for clockwork?

Where do I place the clockwork schedule code? (Cant load it in rails
because there should only be one instance of it running)
Any way to run it together with Sidekiq's process without having another
clockwork daemon/process to monitor?

Thanks for the help

Regards,
John

On Wed, Sep 19, 2012 at 3:19 PM, Jesse Cooke <jesse@jc00ke.com> wrote:

>
> On Sep 18, 2012 11:42 PM, "John Wong" <john@flexnode.com> wrote:
> >
> > Hi,
> >
> > Excellent work on the Sidekiq project. Just a short question.
> >
> > Any examples of how to use clockwork for Rails 3 and Sidekiq?
> > The one in the examples folder doesn't seem to help
> Can you explain what you mean by "doesn't seem to help"
>
> All you should do from clockwork is call perform_async on your worker
> class.
> >
> > John
>



-- 
Regards,
*John Wong*
Flexnode Solutions
www.flexnode.com

Twitter : @princenamor
Skype : john.wcl

*startnow.com.my* - A community of visionaries wanting to bring their ideas
to life.
*showtimes.my* - Movie Showtimes done right

Re: [sidekiq] Clockwork & Rails 3 Sidekiq intergration

From:
Jesse Cooke
Date:
2012-09-19 @ 15:25
On Sep 19, 2012 12:56 AM, "John Wong" <john@flexnode.com> wrote:
>
> Hi Jesse,
>
> Sorry for the vague explanation ...
>
> Is there some guidelines on production server setup for clockwork?
>
> Where do I place the clockwork schedule code? (Cant load it in rails
because there should only be one instance of it running)
> Any way to run it together with Sidekiq's process without having another
clockwork daemon/process to monitor?
No, it is meant to be a separate process. I'd suggest you check out the
Clockwork docs for help configuring it. It's outside the scope of this
mailing list.
>
> Thanks for the help
>
> Regards,
> John
>
> On Wed, Sep 19, 2012 at 3:19 PM, Jesse Cooke <jesse@jc00ke.com> wrote:
>>
>>
>> On Sep 18, 2012 11:42 PM, "John Wong" <john@flexnode.com> wrote:
>> >
>> > Hi,
>> >
>> > Excellent work on the Sidekiq project. Just a short question.
>> >
>> > Any examples of how to use clockwork for Rails 3 and Sidekiq?
>> > The one in the examples folder doesn't seem to help
>> Can you explain what you mean by "doesn't seem to help"
>>
>> All you should do from clockwork is call perform_async on your worker
class.
>> >
>> > John
>
>
>
>
> --
> Regards,
> John Wong
> Flexnode Solutions
> www.flexnode.com
>
> Twitter : @princenamor
> Skype : john.wcl
>
> startnow.com.my - A community of visionaries wanting to bring their ideas
to life.
> showtimes.my - Movie Showtimes done right
>
>

Re: [sidekiq] Clockwork & Rails 3 Sidekiq intergration

From:
John Wong
Date:
2012-09-20 @ 17:40
Thanks for the response...  Will use conventional methods instead..
Thought if Sidekiq uses a single control instance i could hook on clockwork
there..



On Wed, Sep 19, 2012 at 11:25 PM, Jesse Cooke <jesse@jc00ke.com> wrote:

>
> On Sep 19, 2012 12:56 AM, "John Wong" <john@flexnode.com> wrote:
> >
> > Hi Jesse,
> >
> > Sorry for the vague explanation ...
> >
> > Is there some guidelines on production server setup for clockwork?
> >
> > Where do I place the clockwork schedule code? (Cant load it in rails
> because there should only be one instance of it running)
> > Any way to run it together with Sidekiq's process without having another
> clockwork daemon/process to monitor?
> No, it is meant to be a separate process. I'd suggest you check out the
> Clockwork docs for help configuring it. It's outside the scope of this
> mailing list.
> >
> > Thanks for the help
> >
> > Regards,
> > John
> >
> > On Wed, Sep 19, 2012 at 3:19 PM, Jesse Cooke <jesse@jc00ke.com> wrote:
> >>
> >>
> >> On Sep 18, 2012 11:42 PM, "John Wong" <john@flexnode.com> wrote:
> >> >
> >> > Hi,
> >> >
> >> > Excellent work on the Sidekiq project. Just a short question.
> >> >
> >> > Any examples of how to use clockwork for Rails 3 and Sidekiq?
> >> > The one in the examples folder doesn't seem to help
> >> Can you explain what you mean by "doesn't seem to help"
> >>
> >> All you should do from clockwork is call perform_async on your worker
> class.
> >> >
> >> > John
> >
> >
> >
> >
> > --
> > Regards,
> > John Wong
> > Flexnode Solutions
> > www.flexnode.com
> >
> > Twitter : @princenamor
> > Skype : john.wcl
> >
> > startnow.com.my - A community of visionaries wanting to bring their
> ideas to life.
> > showtimes.my - Movie Showtimes done right
> >
> >
>
>

Re: [sidekiq] Clockwork & Rails 3 Sidekiq intergration

From:
Jesse Cooke
Date:
2012-09-20 @ 17:46
On Thu, Sep 20, 2012 at 10:40 AM, John Wong <john@flexnode.com> wrote:

> Thanks for the response...  Will use conventional methods instead..

Curious, what exactly are you trying to do? Using something like Clockwork
is pretty conventional.
All your Clockwork tasks should do is call a job. Clockwork is basically an
event loop, so you don't
want to do any processing in the task.

> Thought if Sidekiq uses a single control instance i could hook on
> clockwork there..
>
You can schedule jobs with Sidekiq, but you need a trigger. Clockwork could
be that independent trigger.

>
>
>
> On Wed, Sep 19, 2012 at 11:25 PM, Jesse Cooke <jesse@jc00ke.com> wrote:
>
>>
>> On Sep 19, 2012 12:56 AM, "John Wong" <john@flexnode.com> wrote:
>> >
>> > Hi Jesse,
>> >
>> > Sorry for the vague explanation ...
>> >
>> > Is there some guidelines on production server setup for clockwork?
>> >
>> > Where do I place the clockwork schedule code? (Cant load it in rails
>> because there should only be one instance of it running)
>> > Any way to run it together with Sidekiq's process without having
>> another clockwork daemon/process to monitor?
>> No, it is meant to be a separate process. I'd suggest you check out the
>> Clockwork docs for help configuring it. It's outside the scope of this
>> mailing list.
>> >
>> > Thanks for the help
>> >
>> > Regards,
>> > John
>> >
>> > On Wed, Sep 19, 2012 at 3:19 PM, Jesse Cooke <jesse@jc00ke.com> wrote:
>> >>
>> >>
>> >> On Sep 18, 2012 11:42 PM, "John Wong" <john@flexnode.com> wrote:
>> >> >
>> >> > Hi,
>> >> >
>> >> > Excellent work on the Sidekiq project. Just a short question.
>> >> >
>> >> > Any examples of how to use clockwork for Rails 3 and Sidekiq?
>> >> > The one in the examples folder doesn't seem to help
>> >> Can you explain what you mean by "doesn't seem to help"
>> >>
>> >> All you should do from clockwork is call perform_async on your worker
>> class.
>> >> >
>> >> > John
>> >
>> >
>> >
>> >
>> > --
>> > Regards,
>> > John Wong
>> > Flexnode Solutions
>> > www.flexnode.com
>> >
>> > Twitter : @princenamor
>> > Skype : john.wcl
>> >
>> > startnow.com.my - A community of visionaries wanting to bring their
>> ideas to life.
>> > showtimes.my - Movie Showtimes done right
>> >
>> >
>>
>>
>
>

Re: [sidekiq] Clockwork & Rails 3 Sidekiq intergration

From:
John Wong
Date:
2012-09-21 @ 09:38
I'm trying to find the cheapest and simplest way to implement Cron like
recurring jobs (eg every 15 seconds)

Resque has a plugin that allows that
https://github.com/bvandenbos/resque-scheduler

Cheapest meaning i wont have to load my environment to schedule a job (eg
Cron via rake)
Simplest meaning I dont want another process to monitor ..   (eg clockwork)
Haivng only a single daemon to monitor (Sidekiq) would be ideal..




On Fri, Sep 21, 2012 at 1:46 AM, Jesse Cooke <jesse@jc00ke.com> wrote:

> On Thu, Sep 20, 2012 at 10:40 AM, John Wong <john@flexnode.com> wrote:
>
>> Thanks for the response...  Will use conventional methods instead..
>
> Curious, what exactly are you trying to do? Using something like Clockwork
> is pretty conventional.
> All your Clockwork tasks should do is call a job. Clockwork is basically
> an event loop, so you don't
> want to do any processing in the task.
>
>> Thought if Sidekiq uses a single control instance i could hook on
>> clockwork there..
>>
> You can schedule jobs with Sidekiq, but you need a trigger. Clockwork
> could be that independent trigger.
>
>>
>>
>>
>> On Wed, Sep 19, 2012 at 11:25 PM, Jesse Cooke <jesse@jc00ke.com> wrote:
>>
>>>
>>> On Sep 19, 2012 12:56 AM, "John Wong" <john@flexnode.com> wrote:
>>> >
>>> > Hi Jesse,
>>> >
>>> > Sorry for the vague explanation ...
>>> >
>>> > Is there some guidelines on production server setup for clockwork?
>>> >
>>> > Where do I place the clockwork schedule code? (Cant load it in rails
>>> because there should only be one instance of it running)
>>> > Any way to run it together with Sidekiq's process without having
>>> another clockwork daemon/process to monitor?
>>> No, it is meant to be a separate process. I'd suggest you check out the
>>> Clockwork docs for help configuring it. It's outside the scope of this
>>> mailing list.
>>> >
>>> > Thanks for the help
>>> >
>>> > Regards,
>>> > John
>>> >
>>> > On Wed, Sep 19, 2012 at 3:19 PM, Jesse Cooke <jesse@jc00ke.com> wrote:
>>> >>
>>> >>
>>> >> On Sep 18, 2012 11:42 PM, "John Wong" <john@flexnode.com> wrote:
>>> >> >
>>> >> > Hi,
>>> >> >
>>> >> > Excellent work on the Sidekiq project. Just a short question.
>>> >> >
>>> >> > Any examples of how to use clockwork for Rails 3 and Sidekiq?
>>> >> > The one in the examples folder doesn't seem to help
>>> >> Can you explain what you mean by "doesn't seem to help"
>>> >>
>>> >> All you should do from clockwork is call perform_async on your worker
>>> class.
>>> >> >
>>> >> > John
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > Regards,
>>> > John Wong
>>> > Flexnode Solutions
>>> > www.flexnode.com
>>> >
>>> > Twitter : @princenamor
>>> > Skype : john.wcl
>>> >
>>> > startnow.com.my - A community of visionaries wanting to bring their
>>> ideas to life.
>>> > showtimes.my - Movie Showtimes done right
>>> >
>>> >
>>>
>>>
>>
>>
>

Re: [sidekiq] Clockwork & Rails 3 Sidekiq intergration

From:
Jesse Cooke
Date:
2012-09-21 @ 16:14
On Fri, Sep 21, 2012 at 2:38 AM, John Wong <john@flexnode.com> wrote:

> I'm trying to find the cheapest and simplest way to implement Cron like
> recurring jobs (eg every 15 seconds)
>
> Resque has a plugin that allows that
> https://github.com/bvandenbos/resque-scheduler
>
> Cheapest meaning i wont have to load my environment to schedule a job (eg
> Cron via rake)
>
Clockwork runs once, so it only loads your Rails env once, like Sidekiq.

> Simplest meaning I dont want another process to monitor ..   (eg clockwork)
>
You already have to monitor Sidekiq. It's not hard to monitor Clockwork. ;)

> Haivng only a single daemon to monitor (Sidekiq) would be ideal..
>
Well, your job could reschedule itself[1] but that sounds complicated & it
might backfire.

If you come up with another solution, please share. We definitely recommend
Clockwork for these
kinds of scenarios though.

[1] https://github.com/mperham/sidekiq/wiki/Scheduled-Jobs

>
>
>
>
> On Fri, Sep 21, 2012 at 1:46 AM, Jesse Cooke <jesse@jc00ke.com> wrote:
>
>> On Thu, Sep 20, 2012 at 10:40 AM, John Wong <john@flexnode.com> wrote:
>>
>>> Thanks for the response...  Will use conventional methods instead..
>>
>> Curious, what exactly are you trying to do? Using something like
>> Clockwork is pretty conventional.
>> All your Clockwork tasks should do is call a job. Clockwork is basically
>> an event loop, so you don't
>> want to do any processing in the task.
>>
>>> Thought if Sidekiq uses a single control instance i could hook on
>>> clockwork there..
>>>
>> You can schedule jobs with Sidekiq, but you need a trigger. Clockwork
>> could be that independent trigger.
>>
>>>
>>>
>>>
>>> On Wed, Sep 19, 2012 at 11:25 PM, Jesse Cooke <jesse@jc00ke.com> wrote:
>>>
>>>>
>>>> On Sep 19, 2012 12:56 AM, "John Wong" <john@flexnode.com> wrote:
>>>> >
>>>> > Hi Jesse,
>>>> >
>>>> > Sorry for the vague explanation ...
>>>> >
>>>> > Is there some guidelines on production server setup for clockwork?
>>>> >
>>>> > Where do I place the clockwork schedule code? (Cant load it in rails
>>>> because there should only be one instance of it running)
>>>> > Any way to run it together with Sidekiq's process without having
>>>> another clockwork daemon/process to monitor?
>>>> No, it is meant to be a separate process. I'd suggest you check out the
>>>> Clockwork docs for help configuring it. It's outside the scope of this
>>>> mailing list.
>>>> >
>>>> > Thanks for the help
>>>> >
>>>> > Regards,
>>>> > John
>>>> >
>>>> > On Wed, Sep 19, 2012 at 3:19 PM, Jesse Cooke <jesse@jc00ke.com>
>>>> wrote:
>>>> >>
>>>> >>
>>>> >> On Sep 18, 2012 11:42 PM, "John Wong" <john@flexnode.com> wrote:
>>>> >> >
>>>> >> > Hi,
>>>> >> >
>>>> >> > Excellent work on the Sidekiq project. Just a short question.
>>>> >> >
>>>> >> > Any examples of how to use clockwork for Rails 3 and Sidekiq?
>>>> >> > The one in the examples folder doesn't seem to help
>>>> >> Can you explain what you mean by "doesn't seem to help"
>>>> >>
>>>> >> All you should do from clockwork is call perform_async on your
>>>> worker class.
>>>> >> >
>>>> >> > John
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > --
>>>> > Regards,
>>>> > John Wong
>>>> > Flexnode Solutions
>>>> > www.flexnode.com
>>>> >
>>>> > Twitter : @princenamor
>>>> > Skype : john.wcl
>>>> >
>>>> > startnow.com.my - A community of visionaries wanting to bring their
>>>> ideas to life.
>>>> > showtimes.my - Movie Showtimes done right
>>>> >
>>>> >
>>>>
>>>>
>>>
>>>
>>
>
>

Re: [sidekiq] Clockwork & Rails 3 Sidekiq intergration

From:
André Rodrigues Pereira
Date:
2012-09-21 @ 11:26
Did you already tried whenever <https://github.com/javan/whenever> gem?

Appears that in your case it can be applied...

Atenciosamente,
André Rodrigues Pereira