These are chat archives for akkadotnet/AkkaStreams

28th
Jun 2017
Sean Farrow
@SeanFarrow
Jun 28 2017 03:40
The code I'm trying to conver is:
var completionState: Option[Try[Unit]] = None
And then later:
def checkForCompletion() =
if (isClosed(in) && inFlight <= 0) {
completionState match {
case Some(Success(_)) => completeStage()
case Some(Failure(ex)) => failStage(ex)
case None => failStage(new IllegalStateException("Stage completed, but there is no info about status"))
}
}
Should I use an Enum for the completion state? That way we can use a switch statement and try doesn't come in to it!