So I think we should move getting the callback into the Router class, and we should move the actual handling of the Controller to the controller, so Call.handle() and Call.handle_error() would just call Controller.handle() and Controller.handle_error() respectively.
This was the original note I had on it:
add a Controller.handle() method that will handle most everything, call will defer to that method and maybe handle_error will also defer to the Controller.handle_error method
I also think Router should have a _callback_name_cache that will find all the GET, POST, etc. methods in the controller, this way it will only have to inspect the controller once and then it will have it all so subsequent requests won't have to search for the method they want.
So I think we should move getting the callback into the Router class, and we should move the actual handling of the Controller to the controller, so
Call.handle()
andCall.handle_error()
would just callController.handle()
andController.handle_error()
respectively.This was the original note I had on it:
I also think Router should have a
_callback_name_cache
that will find all theGET
,POST
, etc. methods in the controller, this way it will only have to inspect the controller once and then it will have it all so subsequent requests won't have to search for the method they want.