Skip to content
This repository has been archived by the owner on Jan 1, 2022. It is now read-only.

Introduce shared mutable context between update handlers #12

Open
tuscen opened this issue Dec 10, 2017 · 1 comment
Open

Introduce shared mutable context between update handlers #12

tuscen opened this issue Dec 10, 2017 · 1 comment
Labels

Comments

@tuscen
Copy link
Member

tuscen commented Dec 10, 2017

What do you think of the idea making update handlers more like middlewares is ASP.NET Core which share mutable context instance? That way there could be a common session middleware (e.g. with separate storages for a chat and a user). Or a middleware that constructs ClaimsPrincipal and attaches it to the context instance. It would open possibilities to leverage existing packages from ASP.NET Core that aren't tied to HttpContext or HTTP in general like Authorization.

@tuscen
Copy link
Member Author

tuscen commented Dec 11, 2017

Upon thinking about this there should be actual middlewares like in ASP.NET Core to properly manage this shared context. So they can cleanup after themeselves after each subsequent middleware invocation. Though I do not know how well this concept of middlewares fits with bots.

@tuscen tuscen added the feature label Mar 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant