You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Change cfg directives to use async-std channels and executor if
nothing is specified via rust flags.
- Add new empty RUSTFLAGS matrix variant to CI jobs.
- Add a justfile for local testing.
- Update README.
Copy file name to clipboardExpand all lines: README.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,25 @@
2
2
3
3
This crate exports four things:
4
4
5
-
- A compatibility/abstraction layer for writing async-executor agnostic code. We support two async executors: async-std and tokio. Each may be toggled with a configuration flag.
6
-
- A compatibility/abstraction layer for writing async channel agnostic code. We support three async channel implementations: async-std-channels. Each may be toggled with a configuration flag.
5
+
- A compatibility/abstraction layer for writing async-executor agnostic code. We
6
+
support two async executors: async-std and tokio. Each may be toggled with a
7
+
configuration flag.
8
+
- A compatibility/abstraction layer for writing async channel agnostic code. We
9
+
support three async channel implementations: async-std, tokio and flume. Each
10
+
may be toggled with a configuration flag.
7
11
- A library exporting a bunch of useful async primitives.
8
12
- A tracing configuration layer optionally supporting console and opentelemetry integration.
9
13
10
14
# Example usage
15
+
By default the `async-std` executor and channels are used.
`async_executor_impl` may be either `tokio` or `async-std`. `async_channel_impl` may be either `tokio`, `async-std`, or `flume`. Note that using `tokio` channels requires `tokio` to be the runtime. Note that the async executor impl and async channel impl must be set in order for this crate to compile successfully.
17
-
23
+
`async_executor_impl` may be either `tokio` or `async-std`. `async_channel_impl`
24
+
may be either `tokio`, `async-std`, or `flume`.
18
25
26
+
Note that using `tokio` channels requires `tokio` to be the runtime.
std::compile_error! {"The cfg flag async_executor_impl must be set in rustflags to either \"async-std\" or \"tokio\" for this crate. Try adding `--cfg async_executor_impl=\"tokio\""}
14
12
15
13
/// A mutex that can register subscribers to be notified. This works in the same way as [`Mutex`], but has some additional functions:
compile_error!("async_executor_impl = 'async-std-executor' and async_channel_impl = 'channel-tokio' cannot be used together; 'channel-tokio' needs the tokio runtime");
0 commit comments