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).
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: