inprocess: Don't wrap OsIpcReceiver
to make it Sync
#107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Wrap the inprocess receiver in a simple
RefCell<>
instead ofArc<Mutex<>>
(again).Adding the mutex here is not a good idea: it only adds overhead and
potential errors, since not all of the other backends have a
Sync
receiver either; nor does the
mpsc
mechanismipc-channel
is modelledafter. In fact it fundamentally violates the "single receiver" aspect of
mpsc
, as outlined in#89 (comment)
Users can still wrap it explicitly if they need to, and know it doesn't
introduce incorrect behaviour in the specific use case.
This change mostly reverts the
Receiver
part of30b2024 ; it doesn't re-introduce the
explicit
Sync
declaration forReceiver
though, as that was/isclearly not true without the Mutex -- nor really desirable, as explained
above. This change also doesn't touch the
Sender
part, which is adifferent story.