how to use `Flow` and `Either`? is having `Flow&lt...
# arrow
m
how to use
Flow
and
Either
? is having
Flow<Either<A, B>>
a good option? also, are there any plans for some monadic streaming Flow-like API?
👍 1
s
We’re using Flow<Either<A, B>> quite a lot, it works quite well for a continuous flow of items that sometimes are successful, sometimes not. Sometimes might also want to do Either<A, Flow<B>> instead, if you want to get back whether you should start observing a flow, or if something went wrong and you get what went wrong in A. But most often than not what you probably want is what you said yourself. I wonder how you’d like that flow-like API that you’re referring to to look like?
m
thanks for the response
about that flow-like API. hmmm…. am not completely sure what exactly I want to see there. I didn’t give it much of a thought. my main problem with
Flow
here is that it throws. it doesn’t support construct either success or error. it’s possible to address this by emitting
Either
from it but that throwing part still remains. now that am thinking about it it’s not that big of a deal actually
am it needs throws for cancelations etc. am not sure
299 Views