Skip to content

Commit

Permalink
Document cargo features
Browse files Browse the repository at this point in the history
  • Loading branch information
zesterer authored Aug 16, 2023
1 parent 431524d commit 5c4d82d
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,28 @@ fn main() {

To use Flume, place the following line under the `[dependencies]` section in your `Cargo.toml`:

```
```toml
flume = "x.y"
```

## Cargo Features

Flume comes with several optional features:

- `spin`: use spinlocks instead of OS-level synchronisation primitives internally for some kind of data access (may be more performant on a small number of platforms for specific workloads)

- `select`: Adds support for the [`Selector`](https://docs.rs/flume/latest/flume/select/struct.Selector.html) API, allowing a thread to wait on several channels/operations at once

- `async`: Adds support for the [async API](https://docs.rs/flume/latest/flume/async/index.html), including on otherwise synchronous channels

- `eventual-fairness`: Use randomness in the implementation of `Selector` to avoid biasing/saturating certain events over others

You can enable these features by changing the dependency in your `Cargo.toml` like so:

```toml
flume = { version = "x.y", default-features = false, features = ["async", "select"] }
```

## [Benchmarks](https://what-if.xkcd.com/147/)

Although Flume has its own extensive benchmarks, don't take it from here that Flume is quick.
Expand Down

0 comments on commit 5c4d82d

Please sign in to comment.