Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Gracefully Stop PeriodCallback During Shutdown
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Calvin  
View profile  
 More options Aug 26 2012, 6:39 pm
From: Calvin <calvinwyo...@gmail.com>
Date: Sun, 26 Aug 2012 15:39:10 -0700 (PDT)
Local: Sun, Aug 26 2012 6:39 pm
Subject: Re: [tornado] Gracefully Stop PeriodCallback During Shutdown

I've taken a look through the code, but haven't been able to figure it out
myself.

If anyone else has a couple of clock cycles to spare, I'm sure Jon and I
would both really appreciate any help.  Again, the question is about how to
poll for the completion of all IO handlers and PeriodicCallbacks before
shutting down the IOLoop.

Thanks!

On Thursday, August 23, 2012 4:13:54 PM UTC-7, Jon Parise wrote:

> I took a closer look at this code against Tornado 2.3, and it doesn't
> behave quite the same way as when I originally wrote it a couple of
> years back.  For example, the polling behavior doesn't appear to be
> working as it once did.  I don't know if something changed in the
> surrounding code or in Tornado itself, but I'm afraid I don't have the
> time to dig into it at the moment.

> If you learn anything useful, however, I'd appreciate hearing about it.

> On Wed, Aug 22, 2012 at 2:44 PM, Calvin <calvin...@gmail.com <javascript:>>
> wrote:
> > Ahh this is awesome -- looks like what I was looking for.

> > But I do one question about how it works.  On line 20 of your gist, you
> > check that there's only a single element in the _handlers list before
> > stopping the ioloop.  Reading through the ioloop code, I can see that
> > PeriodicCallbacks push _Timeouts onto the _timeout queue, but I fail to
> see
> > how that relates to the _handlers queue.  Why does checking the
> _handlers
> > queue work here?

> > Thanks again!

> > On Wednesday, August 22, 2012 12:42:26 PM UTC-7, Jon Parise wrote:

> >> On Wed, Aug 22, 2012 at 11:03 AM, Calvin <calvin...@gmail.com> wrote:
> >> > Hi all,

> >> > I have a PeriodicCallback that makes HTTP requests to an external API
> >> > via
> >> > SimpleAsyncHTTPClient.  Whenever a request is made, it's important to
> >> > record
> >> > the response in the datatabase; missing a response is bad.

> >> > Whenever I shut down the Tornado server, I run the risk of doing so
> in
> >> > the
> >> > middle of a request, which would cause my application to miss
> recording
> >> > a
> >> > response.  Is there a way to gracefully shut down Tornado, but block
> if
> >> > the
> >> > PeriodicCallback is currently running?

> >> I use a graceful shutdown process in my application.  It blocks for up
> >> to 10 seconds while it waits for IO loop handlers to complete.

> >> Here's the code: https://gist.github.com/3428652


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.