Feature: The 'none' router
Problem Statement
In high-throughput applications, the Hazaar router introduces unnecessary overhead when routing is not required. Currently, there is no way to completely disable the router, forcing it to initialize and execute even when manual controller selection is preferred. Adding a 'none'
router type would allow developers to bypass the router entirely, reducing execution cycles and improving performance.
Who will benefit?
- Developers working on high-performance applications where every millisecond counts.
- Applications that have a predefined execution path and do not require dynamic routing.
- Use-cases where the controller is determined manually before calling
Hazaar\Application::run()
.
Benefits and risks
Benefits
- Reduces execution overhead by eliminating unnecessary routing logic.
- Improves performance in high-throughput applications.
- Provides greater flexibility for developers who prefer manual controller handling.
Risks
- Developers must ensure that a valid controller is manually provided; otherwise, the application may fail to function properly.
- Some internal components may expect routing to be present, so careful handling is required to prevent unexpected behavior.
Proposed Solution
- Implement a new
'none'
router type in Hazaar. - When this router type is selected, the router will not be initialized or executed.
- Require developers to manually provide a controller when calling
Hazaar\Application::run()
. - Ensure that the absence of a router does not cause unintended side effects in other parts of the framework.
Priority/Severity
-
High (This will bring a huge increase in performance/productivity/usability/legislative cover) -
Medium (This will bring a good increase in performance/productivity/usability) -
Low (anything else e.g., trivial, minor improvements)