3 ms·
Exactly this. Your dependencies are not request scoped, so there is no reason for them to be included in a per-request context. Instead, dependencies should be
by Cyph0n 3y ago
Exactly this. Your dependencies are not request scoped, so there is no reason for them to be included in a per-request context. Instead, dependencies should be passed in to and stored in the struct that uses them.
The data you store in the context should be specific to the current request. Think: request ID, user ID, auth info, etc.
- bbkane 3y agoThanks for this perspective - "request scoped" seems like a really good guideline for context data