Skip to content

Commit e2e89d2

Browse files
committed
Add documentation of new functionality
1 parent 6345794 commit e2e89d2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,20 @@ impl<T> Event<T> {
256256
///
257257
/// In certain cases, this function emits a `SeqCst` fence before notifying listeners.
258258
///
259+
/// This function returns the number of [`EventListener`]s that were notified by this call.
260+
///
261+
/// # Caveats
262+
///
263+
/// If the `std` feature is disabled, the notification will be delayed under high contention,
264+
/// such as when another thread is taking a while to `notify` the event. In this circumstance,
265+
/// this function will return `0` instead of the number of listeners actually notified. Therefore
266+
/// if the `std` feature is disabled the return value of this function should not be relied upon
267+
/// for soundness and should be used only as a hint.
268+
///
269+
/// If the `std` feature is enabled, no spurious returns are possible, since the `std`
270+
/// implementation uses system locking primitives to ensure there is no unavoidable
271+
/// contention.
272+
///
259273
/// # Examples
260274
///
261275
/// Use the default notification strategy:

0 commit comments

Comments
 (0)