-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
sdk.Router should be stateful #5455
Labels
C:baseapp
S:proposed
T: API Breaking
Breaking changes that impact APIs and the SDK only (not state machine).
Comments
11 tasks
ref: #5452 |
Given that we can still simply use the current/default stateless router, I don't have any strong objections against providing the option to use stateful routers. Unless anyone can state strong objective reasons for not doing so, I think we can go forward with this proposal 👍 Do you intend to have #5452 close this issue? |
alexanderbez
added
C:baseapp
S:proposed
T: API Breaking
Breaking changes that impact APIs and the SDK only (not state machine).
labels
Jan 1, 2020
11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C:baseapp
S:proposed
T: API Breaking
Breaking changes that impact APIs and the SDK only (not state machine).
Summary
The sdk.Router interface should be generalized to allow for more stateful router implementations.
Problem Definition
The basic default router included in baseapp is a stateless router i.e. the mapping from path strings to handlers is static and defined in the application codebase (in the app.go). However, the requirement to remain stateless is limiting in that it restricts the ability to do more complex modifications of routes.
Some examples of advanced router functionality that need statefulness:
Proposal
.Route()
function to take in ansdk.Context
as an argumentbaseapp.Router
implementation as the stateless design it is right nowbaseapp.Router
by default unless intentionally passed a new router by an application'sapp.go
baseapp.WithRouter()
function to allow anapp.go
to pass in its own router implementation.For Admin Use
The text was updated successfully, but these errors were encountered: