method stream.pullWithin
Like pull, but gives up after d with Timeout. Streams backed by a callback source that cannot be
interrupted (remote streams) wait without limit.
Example:
fn slow() -> stream<i64> time {
sleep(300ms)
yield 1
}
fn main() io, time {
var s = slow()
match s.pullWithin(20ms) {
Pulled.Timeout => print("nothing yet")
_ => print("too fast")
}
}Output
nothing yet
pub(api) var fn pullWithin(d: Duration) -> Pulled<T, E>Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
d | Duration |
Returns
Pulled<T, E>
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/stream.oxl:96