Feature: The 'none' router #318

Closed
opened 2025-02-24 23:54:58 +00:00 by jamie · 4 comments
jamie commented 2025-02-24 23:54:58 +00:00 (Migrated from git.hazaar.io)

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

  1. Implement a new 'none' router type in Hazaar.
  2. When this router type is selected, the router will not be initialized or executed.
  3. Require developers to manually provide a controller when calling Hazaar\Application::run().
  4. 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)
## 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 1. Implement a new `'none'` router type in Hazaar. 2. When this router type is selected, the router will not be initialized or executed. 3. Require developers to manually provide a controller when calling `Hazaar\Application::run()`. 4. Ensure that the absence of a router does not cause unintended side effects in other parts of the framework. ## Priority/Severity - [x] 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)
jamie commented 2025-02-24 23:54:58 +00:00 (Migrated from git.hazaar.io)

assigned to @jamie

assigned to @jamie
jamie commented 2025-02-28 08:55:50 +00:00 (Migrated from git.hazaar.io)

created branch 318-feature-the-none-router to address this issue

created branch [`318-feature-the-none-router`](/hazaar/framework/-/compare/master...318-feature-the-none-router) to address this issue
jamie commented 2025-02-28 08:56:01 +00:00 (Migrated from git.hazaar.io)

mentioned in merge request !199

mentioned in merge request !199
jamie commented 2025-02-28 09:32:55 +00:00 (Migrated from git.hazaar.io)

mentioned in commit 16257ed941

mentioned in commit 16257ed9419f188bcbb042aef4f82e6cde68d777
jamie (Migrated from git.hazaar.io) closed this issue 2025-02-28 09:32:55 +00:00
jamie self-assigned this 2025-09-04 01:14:39 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: hazaar/framework#318
No description provided.