You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browsing the code, it looks like the Page Handlers cascade by calling the handle() function in all of the handlers in its vector. The first thing this handler does is check if the cracked uri portion matches its part and return unhandled() if it does not match.
Could this be made more efficient by storing the handlers as a map of URI portion -> handler so that when a request comes in, the handler can crack off part of the url and call the handle method on all of the handlers inserted into the map under the key matching that map?
It's definitely possible I am misunderstanding the code so please correct me if I'm mistaken.
The text was updated successfully, but these errors were encountered:
The handle() function may choose to take an action (e.g. annotate the request with user information) without handling the request. This cascade allows things like authentication handlers to run "high up", and/or hierarchical page handling to be handled later on.
I agree it's not very efficient, but even in the most complex Seasocks setups I've used there's never more than a dozen handlers: iterating over them is not a real bottleneck.
Browsing the code, it looks like the Page Handlers cascade by calling the
handle()
function in all of the handlers in its vector. The first thing this handler does is check if the cracked uri portion matches its part and returnunhandled()
if it does not match.Could this be made more efficient by storing the handlers as a map of URI portion -> handler so that when a request comes in, the handler can crack off part of the url and call the handle method on all of the handlers inserted into the map under the key matching that map?
It's definitely possible I am misunderstanding the code so please correct me if I'm mistaken.
The text was updated successfully, but these errors were encountered: