OxL Reference

method Broadcast.clone

Another handle of the same hub.

Example:

oxl✓ checked in CI
use std.stream { Broadcast }

fn main() io {
  let hub = Broadcast<i32>.new(buffer: 4)
  let same = hub.clone()
  var sub = same.subscribe()
  print("{hub.subscribers()}")
}
Output
1
pub(api) fn clone() -> Broadcast<T>

Since. 1.0.0-beta

Returns

Broadcast<T>

Effects

none declared (pure unless the body says otherwise)

Defined in: std/stream/stream.oxl:698

See also