Skip to content

Commit

Permalink
refactor!: avoid using futures crate directly (#2117)
Browse files Browse the repository at this point in the history
Due to the low maintenance and absurd high amount of `unsafe` code in
parts of the `futures` crate, we are trying to avoid usage of it.

Usages are replaced with

- `futures-lite` : general `Future` and `Stream` tooling
- `futures-sink`: `Sink` trait
- `futures-buffered`: faster and safer version of `Futures{Un}Ordered`
- If must be `futures-util` for sink specific things that are missing

## Breaking Changes

- `iroh::node::Node` does not implement `Future` anymore
- `iroh::node::Node::shutdown()` is now `async` and can be awaited upon
to wait for the node to exit
- `iroh_net::util::AbortingJoinHandle`s inner field is not public
anymore, use the `From<JoinHandle>` implementation to contruct it


## Followups

- [x] Apply this to `bao-tree`:
n0-computer/bao-tree#49
- [x] Apply this to `iroh-io`:
n0-computer/iroh-io#6
- [x] Apply this to `quic-rpc`:
n0-computer/quic-rpc#73

---------

Co-authored-by: Ruediger Klaehn <rklaehn@protonmail.com>
  • Loading branch information
dignifiedquire and rklaehn authored Apr 29, 2024
1 parent 7cfa19a commit e6b0d5c
Showing 1 changed file with 164 additions and 121 deletions.
Loading

0 comments on commit e6b0d5c

Please sign in to comment.