I want to add a timer to my GAE application, so I can execute certain
logic at given interval. I tried python's Timer object (http://
www.python.org/doc/2.5.2/lib/timer-objects.html), but it doesn't seem
to work properly.
> I want to add a timer to my GAE application, so I can execute certain
> logic at given interval. I tried python's Timer object (http://www.python.org/doc/2.5.2/lib/timer-objects.html), but it doesn't seem
> to work properly.
On Mon, Nov 17, 2008 at 11:48 AM, Alex Cheng <AlexCheng1...@gmail.com> wrote:
> I want to add a timer to my GAE application, so I can execute certain > logic at given interval. I tried python's Timer object (http:// > www.python.org/doc/2.5.2/lib/timer-objects.html), but it doesn't seem > to work properly.
On 17 Lis, 16:09, A.TNG <tang.j...@gmail.com> wrote:
> On Mon, Nov 17, 2008 at 11:48 AM, Alex Cheng <AlexCheng1...@gmail.com> wrote:
> > I want to add a timer to my GAE application, so I can execute certain
> > logic at given interval. I tried python's Timer object (http://
> >www.python.org/doc/2.5.2/lib/timer-objects.html), but it doesn't seem
> > to work properly.
Main difference is that gaeutilities Cron runs inside your own app
inside requests initiated by regular (human) clients. Cron tasks will
not fire if there are no viewers, but generally every useful site has
at least some page views per day, so that shouldn't be a big problem.
On the other hand, Scheduler Service uses agents that call your url
from external hosts, so the whole thing doesn't depend on human
guests. But those external agents run on my servers, not Google's
ones, so if I were you I woudn't expect them to be that reliable
(altough me being me - I do expect them do be reliable, because I
simply trust myself ;). Also, with gaeutilities you can define any
number of tasks that will execute as often as you like as long as
there are human-initiated page views on your site. Scheduler Service
let's you define only a few schedulers that run at most 1 time per
hour.
Maybe the best thing would be to mix two technologies in new sites,
that is - run Cron tasks from both human and schedulerservice urls and
after your site (hopefully) gets some audience, drop schedulerservice
part?
I used Cron from gaeutilities and it works fine for me.
Finally I can remove a damn button from my page since the user doesn't
need to manually click it to refresh the page but Cron will do it in
the background.
That's really cool!
On Nov 18, 4:20 am, Maciej Pietrzak <mpietr...@gmail.com> wrote:
> On 17 Lis, 16:09, A.TNG <tang.j...@gmail.com> wrote:
> > On Mon, Nov 17, 2008 at 11:48 AM, Alex Cheng <AlexCheng1...@gmail.com> wrote:
> > > I want to add a timer to my GAE application, so I can execute certain
> > > logic at given interval. I tried python's Timer object (http://
> > >www.python.org/doc/2.5.2/lib/timer-objects.html), but it doesn't seem
> > > to work properly.
> Main difference is that gaeutilities Cron runs inside your own app
> inside requests initiated by regular (human) clients. Cron tasks will
> not fire if there are no viewers, but generally every useful site has
> at least some page views per day, so that shouldn't be a big problem.
> On the other hand, Scheduler Service uses agents that call your url
> from external hosts, so the whole thing doesn't depend on human
> guests. But those external agents run on my servers, not Google's
> ones, so if I were you I woudn't expect them to be that reliable
> (altough me being me - I do expect them do be reliable, because I
> simply trust myself ;). Also, with gaeutilities you can define any
> number of tasks that will execute as often as you like as long as
> there are human-initiated page views on your site. Scheduler Service
> let's you define only a few schedulers that run at most 1 time per
> hour.
> Maybe the best thing would be to mix two technologies in new sites,
> that is - run Cron tasks from both human and schedulerservice urls and
> after your site (hopefully) gets some audience, drop schedulerservice
> part?
Just be aware, Cron is extremely new and is still developmental. If
you have problems please report any issues at the gaeutilities project
site. http://code.google.com/p/gaeutilities/
I did my best to test all possible cron syntax to make sure it works
but rewriting that in python was a bit of a chore. Maciej is correct
on the functionality requiring pageviews to your site. It also will
currently only hit the site it's installed on for tasks. I've had a
weird issue where I couldn't submit a ":" to the webapp application
that supports the backend for it. That's why it requires relative,
rather than absolute, urls.
On Nov 18, 2:01 am, Alex Cheng <AlexCheng1...@gmail.com> wrote:
> I used Cron from gaeutilities and it works fine for me.
> Finally I can remove a damn button from my page since the user doesn't
> need to manually click it to refresh the page but Cron will do it in
> the background.
> That's really cool!
> On Nov 18, 4:20 am, Maciej Pietrzak <mpietr...@gmail.com> wrote:
> > On 17 Lis, 16:09, A.TNG <tang.j...@gmail.com> wrote:
> > > On Mon, Nov 17, 2008 at 11:48 AM, Alex Cheng <AlexCheng1...@gmail.com> wrote:
> > > > I want to add a timer to my GAE application, so I can execute certain
> > > > logic at given interval. I tried python's Timer object (http://
> > > >www.python.org/doc/2.5.2/lib/timer-objects.html), but it doesn't seem
> > > > to work properly.
> > Main difference is that gaeutilities Cron runs inside your own app
> > inside requests initiated by regular (human) clients. Cron tasks will
> > not fire if there are no viewers, but generally every useful site has
> > at least some page views per day, so that shouldn't be a big problem.
> > On the other hand, Scheduler Service uses agents that call your url
> > from external hosts, so the whole thing doesn't depend on human
> > guests. But those external agents run on my servers, not Google's
> > ones, so if I were you I woudn't expect them to be that reliable
> > (altough me being me - I do expect them do be reliable, because I
> > simply trust myself ;). Also, with gaeutilities you can define any
> > number of tasks that will execute as often as you like as long as
> > there are human-initiated page views on your site. Scheduler Service
> > let's you define only a few schedulers that run at most 1 time per
> > hour.
> > Maybe the best thing would be to mix two technologies in new sites,
> > that is - run Cron tasks from both human and schedulerservice urls and
> > after your site (hopefully) gets some audience, drop schedulerservice
> > part?