We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supervising a typed actor with many different strategies for different exceptions currently creates a "pyramid of doom":
val myActor = system.spawn( Behaviors .supervise( Behaviors .supervise( Behaviors .supervise(Behaviors .supervise(MyActor()) .onFailure[ExceptionA](SupervisorStrategy.stop.withLogLevel(Level.ERROR))) .onFailure[ExceptionB](SupervisorStrategy.stop.withLogLevel(Level.WARN))) .onFailure[ExceptionC](myRestartStrategy.withLogLevel(Level.WARN))) .onFailure[ExceptionD](myRestartStrategy.withLogLevel(Level.ERROR)), "my-actor")
It would be nice with an API that flattens such a set of supervisions to a shorter one that is easier to parse, perhaps something like:
val myActor = system.spawn( Behaviors .supervise(MyActor()) .onFailure[ExceptionA](SupervisorStrategy.stop.withLogLevel(Level.ERROR)) .onFailure[ExceptionB](SupervisorStrategy.stop.withLogLevel(Level.WARN)) .onFailure[ExceptionC](myRestartStrategy.withLogLevel(Level.WARN)) .onFailure[ExceptionD](myRestartStrategy.withLogLevel(Level.ERROR))), "my-actor")
The text was updated successfully, but these errors were encountered:
I agree. This came up previously in a discussion with @manuelbernhardt and then the suggestion was also the flat syntax.
Sorry, something went wrong.
No branches or pull requests
Supervising a typed actor with many different strategies for different exceptions currently creates a "pyramid of doom":
It would be nice with an API that flattens such a set of supervisions to a shorter one that is easier to parse, perhaps something like:
The text was updated successfully, but these errors were encountered: