add a shutdown function

Bug #134732 reported by Aaron Swartz
2
Affects Status Importance Assigned to Milestone
web.py
Confirmed
Medium
Anand Chitipothu

Bug Description

Lots of web libraries have a shutdown function that:

1. Stops taking new requests.
2. Finishes all the existing requests.
3. Exits.

I guess it'd be nice if web.py had one too. Also, there should be on_shutdown hooks people can set to run.

Revision history for this message
Anand Chitipothu (anandology) wrote : Re: [Bug 134732] add a shutdown function

how about adding on_startup as well?

Revision history for this message
Aaron Swartz (aaronsw) wrote :

> how about adding on_startup as well?

Good idea.

Revision history for this message
Anand Chitipothu (anandology) wrote :

On 8/26/07, Aaron Swartz <email address hidden> wrote:
>
> > how about adding on_startup as well?
>
> Good idea.

Probably not. There is no need for special hook for running something on
startup. That hook can be run directly before calling web.run.
But it can be added anyway for the sake of completeness.

Revision history for this message
Eleanor Berger (intellectronica) wrote :

> There is no need for special hook for running something on
> startup. That hook can be run directly before calling web.run

Having both hooks can come handy in some setups. For example: you may want to hang the same function on both hooks, or you may be constructing a library which needs to be able to do some work (migrate the database, establish a lock on the filesystem, establish an app-wide singleton) on startup and you want to provide a clean, plug-n-play interface.

Revision history for this message
Eleanor Berger (intellectronica) wrote :

Also, `startuphooks` and `shutdownhooks` may be more appropriate names, since they mirror the morphology of `loadhooks` and `unloadhooks`.

Changed in webpy:
assignee: nobody → anandology
importance: Undecided → Medium
milestone: none → 0.3
status: New → Confirmed
Changed in webpy:
milestone: 0.3 → 0.35
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.