smol-rs / async-channel

Async multi-producer multi-consumer channel
Apache License 2.0
769 stars 39 forks source link

added `Receiver::recv_owned` #83

Open emfax opened 6 months ago

emfax commented 6 months ago

Added Receiver::recv_owned as well as supporting types RecvOwned and RecvOwnedInner.

emfax commented 6 months ago

Is it worth looking at some benchmarks to see if the referenced version is even necessary? Would the performance hit for using a cloned receiver be that bad?

notgull commented 6 months ago

Is it worth looking at some benchmarks to see if the referenced version is even necessary? Would the performance hit for using a cloned receiver be that bad?

No matter what an atomic operation is going to be slower than one that doesn't use atomics. Still, benchmarks would be nice