Closed ghostdogpr closed 1 year ago
Maybe UIO[Map[PodAddress, Either[Throwable, Res]]]
The UIO[Map[Pod, Either[Throwable, Res]]]
is probably the most precise response. (Perhaps Try
instead of Either
?). The question is whether the success case should be more prominent in the result type and this precise list of error/partial successes could be returned only in the error case? (IO[Map[Pod, Try[Res]], Map[Pod, Res]]
).
Agreed on Try
. I think a single Map
would be more convenient.
I am trying to write an EndToEnd test with 3 pods (one broadcasting, two listening) but I am struggling a bit :(
I have tested various situations manually and I have not found any issue :)
Will merge and try to apply the snapshot to my work case
The responses are a good idea, the question is, how to handle situations, when some pods respond and some don't. Perhaps the error type for the broadcast could be something like
case class PartialResponse(results: Map[Pod, Try[Res]]) extends Exception
?