Closed plwai closed 4 years ago
@jk-gan Any idea for the context build? This is the only way I can think of now. &mut ctx
is not possible because of the async future lifetime. If we do not return ctx, then the ctx data will be lost.
Possible approach:
ctx.build
like current implementation.
let user to assign all of the data again in response.
abandon context approach, rewrite all the flow.
I think that ctx.build()
is not so clear on what the code is doing. Maybe we can use something like ctx.respond()
or ctx.resp.build()
🤔
Totally agree. My intention to use the ctx.build
is just temporary to resolve the blocker only. We need to decide a naming for it.
I'm thinking other approaches besides this context pattern for the new structure, but so far so good
I'm thinking other approaches besides this context pattern for the new structure, but so far so good
Ya. We should try to explore more approaches.
Redesign http request response flow
[x] Extend context lifetime
[x] Bring
Responder
to context level[x] Fix test case
[x] Documentation
related #44 resolve #47