kanal icon indicating copy to clipboard operation
kanal copied to clipboard

`Stream` that take ownership of the `Receiver`

Open vnghia opened this issue 11 months ago • 1 comments

Hello, thank you very much for this crate. Exactly what I need for my application. I would like to ask:

How expensive to create one ReceiveStream from Receiver ? If that is expensive, can you provide something like tokio ReceiverStream which takes the ownership of Receiver since axum::body::Body::from_stream requires an owned stream.

vnghia avatar Mar 18 '24 16:03 vnghia

Hi, thanks for your kind words. I might consider implementing it in the future. For current ReceiveStream cost is same as single Box allocation and for owned stream performance should be around cloning the channel instance itself + Box allocation, Pull requests are welcome.

fereidani avatar Apr 11 '24 01:04 fereidani