Open oblique opened 4 years ago
Yes, in theory. A few changes need to be made to support that use-case, however. I'll add that to my to-do list for the next few days.
Hi @zesterer! I'm willing to try and work this out. I've checked things here and have a decent idea of how to implement it, but maybe you could give me some directions on what you think should be changed.
I also came up with a sketch of an OwnedSelector
that consumes owned receivers instead of references and is able to be stored in structs without needing lifetimes or 'static leakages, but I'm not sure this is desired. This removes the need to box
the selection every time the selector is built.
But maybe this could be done by having the channel_macro!
do everything on the stack.
Hi @zesterer! I'm willing to try and work this out. I've checked things here and have a decent idea of how to implement it, but maybe you could give me some directions on what you think should be changed.
I also came up with a sketch of an
OwnedSelector
that consumes owned receivers instead of references and is able to be stored in structs without needing lifetimes or 'static leakages, but I'm not sure this is desired. This removes the need tobox
the selection every time the selector is built.But maybe this could be done by having the
channel_macro!
do everything on the stack.
Hi, I can definitely see this working out! Did you have more details about what sort of implementation & API you'd likely be looking to go for?
A common pattern is to use
Selector
in an infinite loop. Now a user need to reconstruct a newSelector
in each iteration becausewait
consumes it. This can have performance impact in high load cases.Is it possible to make
wait
borrowingself
?