Implement Send
for Stream
on certain platforms
#840
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.
Objective
Send
forStream
#818Solution
Moved
NotSendSyncAcrossAllPlatforms
into its own module,maybe_send
(for clarity) and implementedSend
for an instance where (I believe) it is safe to do so. I've deliberately left thecfg
statement controlling this implementation verbose to make it clear how other platforms could be included where it is confirmed to be safe to do so:To add this support to Linux but only on FreeBSD using Jack (as an example) then a single statement can be added without modifying any of the others:
I have deliberately only implemented
Send
on Windows under WASAPI in this pull request as I believe it is known to beSend
safe and should be relatively straight-forward to test. I would encourage others to test on platforms they can also confirm the behaviour on and then make follow-up PRs to increase support.Motivation
I personally ran into this issue myself when working with Bevy and thought it was a little annoying. Not a deal breaker by any stretch of the imagination, the workarounds are well documented and perfectly reasonable. This is more of a quality of life improvement than anything else.