small fixes to stream supervision

This commit is contained in:
Roland Kuhn 2015-02-23 11:54:02 +01:00
parent ac9c61a3a5
commit 2959159e78
4 changed files with 37 additions and 30 deletions

View file

@ -252,8 +252,15 @@ final case class ActorFlowMaterializerSettings(
* overridden for specific sections of the stream operations with
* [[akka.stream.javadsl.OperationAttributes#supervisionStrategy]].
*/
def withSupervisionStrategy(decider: japi.Function[Throwable, Supervision.Directive]): ActorFlowMaterializerSettings =
copy(supervisionDecider = e decider.apply(e))
def withSupervisionStrategy(decider: japi.Function[Throwable, Supervision.Directive]): ActorFlowMaterializerSettings = {
import Supervision._
copy(supervisionDecider = decider match {
case `resumingDecider` => resumingDecider
case `restartingDecider` => restartingDecider
case `stoppingDecider` => stoppingDecider
case other => other.apply _
})
}
def withDebugLogging(enable: Boolean): ActorFlowMaterializerSettings =
copy(debugLogging = enable)