Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Ticket #937 (defect)

Opened 9 months ago

Last modified 8 months ago

Collapse redundant hooks

Status: new

Reported by: fumanchu Assigned to: fumanchu
Priority: normal Milestone: 3.3
Component: CherryPy code Keywords:
Cc:

Order of filters in CherryPy 2

  • on_start_resource

processHeaders()

  • before_request_body

processBody()

  • before_main

main(), which included controller lookup

  • before_finalize

finalize()

  • on_end_resource

Order of hooks in CherryPy 3:

process_headers()
get_resource(), which looks up the controller

  • on_start_resource
  • before_request_body

process_body()

  • before_handler

handler()

  • before_finalize

finalize()

  • on_end_resource

IMO, it would be good to get rid of the 'before_request_body' hookpoint altogether, and move the builtin tools to use 'on_start_resource' instead.

We could ease migration by having the next version of CP move hooks from before_request_body to on_start_resource (with a DeprecationWarning), and adding 100 to their priority so they all run in the same order but after all the ones explicitly set at on_start_resource.

Change History

08/04/09 23:12:57: Modified by fumanchu

  • milestone changed from 3.2 to 3.3.

Hosted by WebFaction

Log in as guest/cpguest to create tickets