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
Reading from the docs about the select macro (and the Select type seems to be the same):
This macro allows you to define a set of channel operations, wait until any one of them becomes ready, and finally execute it. If multiple operations are ready at the same time, a random one among them is selected.
I understand this is a good default choice to not starve some operations. However, there are situations when exactly that is desired ‒ I have a higher priority and lower priority channels. In case I can't keep up with everything, I want to prefer handling the higher priority one.
Does it make sense to also have a SelectOrdered or something, that picks the first operation that is ready (in order of insertion) instead of arbitrary one?
The text was updated successfully, but these errors were encountered:
You could achieve the same end result by first polling operations with try_recv()/try_send() in the desired order, and then falling back to select. Maybe not as pretty as using the hypothetical SelectOrdered, but I hope not too bad either?
Reading from the docs about the
select
macro (and the Select type seems to be the same):I understand this is a good default choice to not starve some operations. However, there are situations when exactly that is desired ‒ I have a higher priority and lower priority channels. In case I can't keep up with everything, I want to prefer handling the higher priority one.
Does it make sense to also have a
SelectOrdered
or something, that picks the first operation that is ready (in order of insertion) instead of arbitrary one?The text was updated successfully, but these errors were encountered: