Ticket #687 (defect)
Opened 1 year ago
Last modified 9 months ago
Dispatcher nesting should be unfolded
Status: new
| Reported by: | fumanchu | Assigned to: | fumanchu |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.2 |
| Component: | CherryPy code | Keywords: | |
| Cc: |
The ability to nest multiple dispatchers (i.e. have one dispatcher call another) is powerful and necessary; however, the current implementation suffers in that Python code cannot inspect the chain of dispatchers. For example:
from cherrypy.dispatch import * hostmap = {'www.mydom2.com': '/mydom2', 'www.mydom3.com': '/mydom3', 'www.mydom4.com': '/dom4', } vh = VirtualHost(next_dispatcher=XMLRPCDispatcher(), **hostmap) cherrypy.tree.mount(root, config={'/': {'request.dispatch': vh}})
Although the VirtualHost dispatcher wraps another dispatcher (and in this case, the XMLRPC dispatcher also wraps the default builtin CherryPy dispatcher), there is no interface exposed to Python code to inspect any dispatcher beyond the outermost one. Having just a simple means to iterate over the dispatchers involved in a chain would be a huge improvement.
Change History
05/01/07 04:27:22: Modified by lawouach
10/26/07 00:35:25: Modified by fumanchu
- milestone changed from 3.1 to 3.2.


Could you show me a use case?
I understand that from a purity perspective it would be nice but I don't quite see how this would add any value currently. Do you want CherryPy to make different decision based on the next dispatcher?
I would not call that a defect either since it's not a bug per se AFAIK.