Skip to content

Commit 1bbb703

Browse files
authored
Update README.md
1 parent 75be543 commit 1bbb703

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Events are in the form of (strings, value) and callbacks are in the form of clos
1414
#### Differences between this crate and [`event-emitter-rs`](https://crates.io/crates/event-emitter-rs)
1515

1616
- Emitted values should implement an extra trait (Debug) in addition to Serde's Serialize and Deserialize.
17-
- This is an async implementation, currently limited to tokio, but async-std will be added soon under a feature flag.
17+
- This is an async implementation, not limited to tokio, but async-std is supported under the ``` use-async-std ``` feature flag.
1818
- The listener methods **_(on and once)_** take a callback that returns a future instead of a merely a closure.
1919
- The emit methods executes each callback on each event by spawning a tokio task instead of a std::thread
2020

@@ -142,6 +142,15 @@ After all, one of the main points of using an EventEmitter is to avoid passing d
142142
}
143143

144144
```
145+
#### Using async-std instead of tokio
146+
Tokio is the default runtime for this library but async-std support can be able enabled by disabling default-features on the crate and enable the ```use-async-std``` feature.
147+
<br>
148+
**Note**: Use simply replace tokio::main with async-std::main and tokio::test with async-std::test (provided you've enabled the "attributes" feature on the crate.
149+
150+
#### Testing
151+
Run the tests on this crate with all-features enabled as follows:
152+
``` cargo test --all-features```
153+
145154

146155
#### License
147156

0 commit comments

Comments
 (0)