Skip to content
New issue

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

Support replyWhileStopped in BackoffSupervisor #3316

Open
ianclegg opened this issue Feb 6, 2018 · 0 comments
Open

Support replyWhileStopped in BackoffSupervisor #3316

ianclegg opened this issue Feb 6, 2018 · 0 comments

Comments

@ianclegg
Copy link
Contributor

ianclegg commented Feb 6, 2018

Akka for Scala introduced a replyWhileStopped feature to the BackoffSupervisor last May. One case where its useful is when using the Ask Pattern. The feature means the Ask gets an immediate response when the child is stopped as part of a backoff, this is often preferential to having the Ask forwarded to DeadLetters by the BackoffSupervisor, thus relying on an Ask timeout. See akka/akka#21213

  Backoff.onFailure(childProps, childName, minBackoff, maxBackoff, randomFactor)
    .withManualReset
    .withSupervisorStrategy(
        OneforOneStrategy(){
        case e: GivingUpException => Stop
        case e: RetryableException => Restart
    })
    .withReplyWhileStopped(TheSystemIsDown)

Obviously adding the feature will increase the API surface slightly, and may involve the addition of a parameter to the BackoffSupervisor constructor (which is public) - though most people will not be using the constructor directly because the factory methods are the general way to go. I'm happy to string together some commits, tests and doc update to get a PR moving, what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants