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
Copy file name to clipboardExpand all lines: README.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Events are in the form of (strings, value) and callbacks are in the form of clos
14
14
#### Differences between this crate and [`event-emitter-rs`](https://crates.io/crates/event-emitter-rs)
15
15
16
16
- 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.
18
18
- The listener methods **_(on and once)_** take a callback that returns a future instead of a merely a closure.
19
19
- The emit methods executes each callback on each event by spawning a tokio task instead of a std::thread
20
20
@@ -142,6 +142,15 @@ After all, one of the main points of using an EventEmitter is to avoid passing d
142
142
}
143
143
144
144
```
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:
0 commit comments