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
Consider removal of warp::ext::set
#222
Milestone
Comments
What would the replacement API look like? |
I'm not certain. Perhaps by adding a way to turn a |
Makes sense 👍 |
seanmonstar
added a commit
that referenced
this issue
Dec 18, 2019
seanmonstar
added a commit
that referenced
this issue
Dec 18, 2019
seanmonstar
added a commit
that referenced
this issue
Dec 18, 2019
masonforest
pushed a commit
to masonforest/warp
that referenced
this issue
Dec 20, 2019
This was referenced Feb 19, 2020
Closed
How to set an extension in latest version of warp? |
fn with_db(pool: Pool) -> impl Filter<Extract = (Pool,), Error = Infallible> + Clone {
warp::any().map(move || pool.clone())
}
let user_create = warp::path!("api" / "user" / "create")
.and(warp::post())
.and(warp::body::json())
.and(with_db(pool.clone()))
.and_then(user::user_create); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It takes advantage of warp's usage of thread-local storage, but that means we can't change away from internally using TLS as long as this function requires it.
The text was updated successfully, but these errors were encountered: