Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin context data #32

Closed
olanod opened this issue Feb 12, 2021 · 0 comments
Closed

Plugin context data #32

olanod opened this issue Feb 12, 2021 · 0 comments

Comments

@olanod
Copy link
Member

olanod commented Feb 12, 2021

Related to #8 and possibly #13, there should be an easy way to have some state that is shared across requests(e.g. a DB connection). One way is attaching data to context that is passed to requests, middlewares and possible plugin life-cycle hooks.

#[hook]
async fn on_created(cx: &mut Context) {...}

#[vlugin]
async fn handler(req: Request, cx: &Context) -> Response {...}
@olanod olanod closed this as completed Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant