-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-concurrencyArea: ConcurrencyArea: ConcurrencyA-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Milestone
Description
We are lacking at least one critical primitive:
recv
onport<T>
with timeout that returns anoption<T>
It may be desirable to recv
from multiple ports at once, which may need
recv
on[port<T>]
that returns(uint, T)
recv
on[port<T>]
with timeout that returnsoption<(uint, T)>
recv_some
on[port<T>]
with timeout that returns[T]
or[(int, T)]
- These calls assume a fixed message type, it would be nice if it was possible to
recv
from a set of differently typed ports at once and match on the result somehow
These calls perhaps would be useful for sending to many channels:
send_any(value: T, channels: [chan<T>])
that returns theuint
vec index of the channel actually used- with the channel selected fairly from
channels
- with the channel selected fairly from
send_ready(value: T, channels: [chan<T>])
that returns theuint
vec index of the channel actually used- with the channel selected fairly among ready channels from
channels
- with the channel selected fairly among ready channels from
send_all(value: T, channels: [chan<T>])
- for convenience
Metadata
Metadata
Assignees
Labels
A-concurrencyArea: ConcurrencyArea: ConcurrencyA-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.