in core/src/main/scala/org/apache/pekko/projection/scaladsl/StatefulHandler.scala [59:72]
final override def process(envelope: Envelope): Future[Done] = {
val newState = state.value match {
case Some(Success(_)) => state
case Some(Failure(_)) => initialState()
case None =>
throw new IllegalStateException(
"Process called before previous Future completed. " +
"Did you share the same handler instance between several Projection instances? " +
"Otherwise, please report issue at " +
"https://github.com/apache/pekko-projection/issues")
}
state = newState.flatMap(s => process(s, envelope))
state.map(_ => Done)
}