One-liner: copy from async stream to async sink?

pseudocode:

src: async_stream<T>;
dst: async_sink<T>;
tokio::spawn( ??? )

where in ??? we want to consume src, dst, and have a task whose sole purpose in life is to copy items from src to dst

Thanks!

StreamExt::forward maybe?

1 Like

That would be

tokio::spawn(channel.forward(sink));

The above is taken verbatim from one of my slides in my talk on actors.

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.