You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A wrapper type for streams that functions almost like take_while but also returns the first value that matches the condition would be nice to have.
My use-case is returning a (grpc) stream that should terminate as soon as one error occurs. However, it is very inconvenient to also return the specific error reason to indicate the stream has not completed normally, but with an error.
The text was updated successfully, but these errors were encountered:
I would also be in need of "failing" a stream, from within (at its .poll_next).
There are two ways of doing this:
the "wrapper" that you suggest. A Stream would produce Result and in the consuming chain, that is detected as an error
remake the Stream implementation so that .poll_next can signal error (currently, it cannot, and this is likely intentional; Result return types are used for this)
I'm familiar with Akka Streams, before coming to Rust, and there a failure in the producer fails the whole stream. That's pretty practical, often, and something we could have - I'll do some experimenting...
A wrapper type for streams that functions almost like take_while but also returns the first value that matches the condition would be nice to have.
My use-case is returning a (grpc) stream that should terminate as soon as one error occurs. However, it is very inconvenient to also return the specific error reason to indicate the stream has not completed normally, but with an error.
The text was updated successfully, but these errors were encountered: