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
{{ message }}
This repository has been archived by the owner on Nov 5, 2018. It is now read-only.
The current Select stores closures for firing cases. This is slow and interacts poorly with the borrow checker.
I think we could have interface like this:
letmut sel:Select<'_> = Select::new();let id1 = sel.add_send(&s);let id2 = sel.add_recv(&r);let id = sel.wait();if id == id1 {let res = sel.finish_send(s, msg);}elseif id == id2 {let res = sel.finish_recv(r);}
Functions finish_send and finish_recv would panic if wrong sender or receiver is passed. Select stores a Token internally that is used for the finishing function call.
Also, we could probably support reusing sel in multiple selections.
As further simplification, we could also:
Remove the codegen in select! and instead "compile" the macro invocation down to Select.
Remove support for sending into iterators of receivers/senders in select! because the syntax odd, it is a niche use case, and can be done using Select anyway.
The text was updated successfully, but these errors were encountered:
The current
Select
stores closures for firing cases. This is slow and interacts poorly with the borrow checker.I think we could have interface like this:
Functions
finish_send
andfinish_recv
would panic if wrong sender or receiver is passed.Select
stores aToken
internally that is used for the finishing function call.Also, we could probably support reusing
sel
in multiple selections.As further simplification, we could also:
select!
and instead "compile" the macro invocation down toSelect
.select!
because the syntax odd, it is a niche use case, and can be done usingSelect
anyway.The text was updated successfully, but these errors were encountered: