mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
8fcea5966c
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/)) |
||
---|---|---|
.. | ||
benches | ||
00_serve.js | ||
01_http.js | ||
Cargo.toml | ||
compressible.rs | ||
http_next.rs | ||
hyper_util_tokioio.rs | ||
lib.rs | ||
network_buffered_stream.rs | ||
reader_stream.rs | ||
README.md | ||
request_body.rs | ||
request_properties.rs | ||
response_body.rs | ||
slab.rs | ||
websocket_upgrade.rs |