You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Channel.receive_first and Channel.send_first discard the index returned by the underlying Channel.select. To handle cases where the channel that performed an operation is significant, I propose Channel.receive_first_with_index for receiving and either a new method Channel.send_first_index or returning the index directly from Channel.send_first and allowing using code to discard it. The discussion at crystal-lang/crystal-book#279 (review) suggests that Channel.select is intended as a low-level interface and that the *_first methods are considered the high-level interface.
Implementation of this should be trivial so I'm willing to submit a PR if everyone is agreeable.
The text was updated successfully, but these errors were encountered:
Channel.receive_first
andChannel.send_first
discard the index returned by the underlyingChannel.select
. To handle cases where the channel that performed an operation is significant, I proposeChannel.receive_first_with_index
for receiving and either a new methodChannel.send_first_index
or returning the index directly fromChannel.send_first
and allowing using code to discard it. The discussion at crystal-lang/crystal-book#279 (review) suggests thatChannel.select
is intended as a low-level interface and that the*_first
methods are considered the high-level interface.Implementation of this should be trivial so I'm willing to submit a PR if everyone is agreeable.
The text was updated successfully, but these errors were encountered: