- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
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:
- recvon- port<T>with timeout that returns an- option<T>
It may be desirable to recv from multiple ports at once, which may need
- recvon- [port<T>]that returns- (uint, T)
- recvon- [port<T>]with timeout that returns- option<(uint, T)>
- recv_someon- [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
 recvfrom 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 the- uintvec 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 the- uintvec 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.