Dumping a whole bunch of state into a `Context` struct is an code smell. If you can't think of a better name than context, then it is probably a poor abstraction.
-
-
Access to the request is done through `ctx.request`. Some values are lifted to `Context`, but not all. I'm thinking if we change our signature to be: async fn(req: Request<State>) -> Result<Response> things will generally feel more intuitive
-
We may need to keep a reference to `Context` inside middleware, but for most people they'll be able to think about "request goes in, response goes out" inside an async + fallible context. Not sure how this would apply for tikv; but this is what I'm thinking for Tide!
- 3 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
How are you planning to resolve it?