Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

41 using internal hooks #48

Closed
wants to merge 5 commits into from
Closed

41 using internal hooks #48

wants to merge 5 commits into from

Conversation

M-jerez
Copy link
Contributor

@M-jerez M-jerez commented Jul 18, 2023

Add a methods to prepend and append hooks.

these hooks are intended for internal router functioning. the goal is that the router only contains logic about creating and dispatching routes, and any other logic related to the request/response parsing serialized etx is handled using hooks.

This is so the router or any other plugging can add hooks without modifying existing routes
Prepend and append hooks should be called called before any register routes so there is no need to remade all the routes.

resolves #41

M-jerez added 5 commits July 15, 2023 13:59
… execution path.

This allows moving all the logic related to handling the request / response to the hooks and makes the router quite more flexible
…lly so any hook can add their own options/settings. And create new core package to solve circular dependencies problems.

Refactor went out of hand and there are quite a bit of changes but in return the router is fully extensible and configurable now.
Still a WIP, pending to fix some test issues
@M-jerez M-jerez self-assigned this Jul 18, 2023
@M-jerez
Copy link
Contributor Author

M-jerez commented Jul 18, 2023

Some work was done to implement this, it required quite a bit changes, creating new pacakges and in general adding complexity. There was quite a bit of degradation as well!

Branch here: https://github.com/MionKit/mion/tree/41-using-internal-hooks

Screenshot 2023-07-17 at 00 00 05
Screenshot 2023-07-17 at 00 00 17

Do to this we are not proceeding with the merging as it has too many disadvantages.
The idea is good so we might want to revisit in the future again. removing the async context will help simplifying things!

@M-jerez M-jerez closed this Jul 18, 2023
@M-jerez M-jerez deleted the 41-using-internal-hooks branch July 21, 2023 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to wrapp already generated routes
1 participant