We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I think it would be cool if we added ScopedValue to Context like this:
ScopedValue
public interface Context { /** Retrieve the current request context */ ScopedValue<Context> SV_CONTEXT = ScopedValue.newInstance(); }
In this way, every HTTP request can access the context like
void main() { Jex.create().routing(routing -> routing.get("/", ctx -> processRequest())).start(); } void processRequest() { Context ctx = Context.SV_CONTEXT.get(); // do whatever with the context }
The text was updated successfully, but these errors were encountered:
If we did it, we'd probably have a static method like:
ScopedValue<Context> SV_CONTEXT = ScopedValue.newInstance(); static Context get() { return SV_CONTEXT.get(); }
So then its use would be:
void processRequest() { Context ctx = Context.get(); // do whatever with the context }
Sorry, something went wrong.
No branches or pull requests
I think it would be cool if we added
ScopedValue
to Context like this:In this way, every HTTP request can access the context like
The text was updated successfully, but these errors were encountered: