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
#1040 added a select_biased! macro. Some internal functions gained an is_biased: bool parameter to support it, but the non-macro public API around the Select type does not expose this functionality at all. Some of those internal functions are only ever called with false. Biased functionality could be useful to add to the Select type but I’m not sure what the API should look like exactly. ~Doubling the number of methods does not feel great.
For context: I’m building a priority queue on top of an array of crossbeam channels. My receiver should block until any of the inner receivers are ready, but then consume one item from the highest-priority channel rather than arbitrary one. (Starvation is mitigated by "ageing" some low-priority items into a one-level-higher priority channel.) As a work-around I call Select::ready() then an explicit loop with Receiver::try_recv(), but this looks like it does redundant work compared to an hypothetical Select::biased_select()
The text was updated successfully, but these errors were encountered:
#1040 added a
select_biased!
macro. Some internal functions gained anis_biased: bool
parameter to support it, but the non-macro public API around theSelect
type does not expose this functionality at all. Some of those internal functions are only ever called withfalse
. Biased functionality could be useful to add to theSelect
type but I’m not sure what the API should look like exactly. ~Doubling the number of methods does not feel great.For context: I’m building a priority queue on top of an array of crossbeam channels. My receiver should block until any of the inner receivers are ready, but then consume one item from the highest-priority channel rather than arbitrary one. (Starvation is mitigated by "ageing" some low-priority items into a one-level-higher priority channel.) As a work-around I call
Select::ready()
then an explicit loop withReceiver::try_recv()
, but this looks like it does redundant work compared to an hypotheticalSelect::biased_select()
The text was updated successfully, but these errors were encountered: