1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00
denoland-deno/ext/http
Laurence Rowe 8fcea5966c
refactor(ext/http): use scopeguard defer to handle async drop (#20652)
Use the [scopeguard](https://docs.rs/scopeguard/) defer macro to run
cleanup code for `new_slab_future`.
This means it can be a single async function, avoiding the need to
create a struct and implement `PinnedDrop`

Async cleanup in Rust is awkward because async functions may be
cancelled at any await point when their Future is dropped.
The scopeguard approach comes from the following articles:
* [How to think about `async`/`await` in
Rust](http://cliffle.com/blog/async-inversion/)
* [Async Cancellation
I](https://blog.yoshuawuyts.com/async-cancellation-1/) (Reddit
[discussion](https://www.reddit.com/r/rust/comments/qrhg39/blog_post_async_cancellation/))
2023-09-26 05:42:48 -06:00
..
benches chore: use rustfmt imports_granularity option (#17421) 2023-01-14 23:18:58 -05:00
00_serve.js fix(ext/http): create a graceful shutdown API (#20387) 2023-09-12 00:06:38 +00:00
01_http.js feat: support import attributes (#20342) 2023-09-07 09:09:16 -04:00
Cargo.toml refactor(ext/http): use scopeguard defer to handle async drop (#20652) 2023-09-26 05:42:48 -06:00
compressible.rs chore: update copyright year to 2023 (#17247) 2023-01-02 21:00:42 +00:00
http_next.rs refactor(ext/http): use scopeguard defer to handle async drop (#20652) 2023-09-26 05:42:48 -06:00
hyper_util_tokioio.rs feat(ext/http): Upgrade to hyper1.0-rc4 (#19987) 2023-07-31 07:34:53 -06:00
lib.rs refactor: rewrite more ops to op2 macro (#20478) 2023-09-14 23:05:18 +02:00
network_buffered_stream.rs chore: fix typos (#19572) 2023-06-26 09:10:27 -04:00
reader_stream.rs chore: update copyright year to 2023 (#17247) 2023-01-02 21:00:42 +00:00
README.md chore: add README to ext/http/ (#11958) 2021-09-08 20:48:28 +02:00
request_body.rs fix(ext/http): ensure aborted bodies throw (#20503) 2023-09-15 08:08:21 -06:00
request_properties.rs refactor(ext/http): generic abstract listeners (#19132) 2023-05-15 16:55:47 +02:00
response_body.rs fix(ext/http): ensure that resources are closed when request is cancelled (#20641) 2023-09-25 17:23:55 +02:00
slab.rs refactor(ext/http): use scopeguard defer to handle async drop (#20652) 2023-09-26 05:42:48 -06:00
websocket_upgrade.rs chore: update to Rust 1.71 (#19822) 2023-07-13 15:16:24 -06:00

deno_http

This crate implements server-side HTTP based on primitives from the Fetch API.