Skip to content

Updated BackoffSupervisor to Akka JVM 2.5.18 #3678

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

Merged
merged 4 commits into from
Jan 10, 2019

Conversation

ismaelhamed
Copy link
Member

Updated BackoffSupervisor to Akka JVM 2.5.18

{
var supervisor = Create(OnStopOptions(maxNrOfRetries: 2));

IActorRef WaitForChild(int n = 0)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have anything like scalatest.concurrent.Eventually? That would simplify this piece of code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AwaitCondition ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly that.

@Aaronontheweb
Copy link
Member

@ismaelhamed is this still a work in progress? or is it ready for review?

@ismaelhamed
Copy link
Member Author

ismaelhamed commented Dec 18, 2018

@Aaronontheweb It's ready for review. I've just updated the tests with the AwaitCondition.

@ismaelhamed
Copy link
Member Author

@Aaronontheweb I have another PR ready, that builds on top of this one, with #25933. This should put the BackoffSupervisor on a par with the JVM.

@Aaronontheweb
Copy link
Member

@ismaelhamed got it - I'll review this again rq

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -3754,22 +3755,29 @@ namespace Akka.Pattern
{
public class static Backoff
{
[System.ObsoleteAttribute("Use the overloaded one which accepts maxNrOfRetries instead.")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

});

supervisor.Tell("boom"); //this will be sent to deadLetters
ExpectNoMsg(500);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -23,9 +23,25 @@ public static class Backoff
/// <param name="minBackoff">Minimum (initial) duration until the child actor will started again, if it is terminated</param>
/// <param name="maxBackoff">The exponential back-off is capped to this duration</param>
/// <param name="randomFactor">After calculation of the exponential back-off an additional random delay based on this factor is added, e.g. `0.2` adds up to `20%` delay. In order to skip this additional delay pass in `0`.</param>
[Obsolete("Use the overloaded one which accepts maxNrOfRetries instead.")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

public abstract Akka.Pattern.BackoffOptions WithSupervisorStrategy(Akka.Actor.OneForOneStrategy supervisorStrategy);
}
public sealed class BackoffSupervisor : Akka.Pattern.BackoffSupervisorBase
{
public BackoffSupervisor(Akka.Actor.Props childProps, string childName, System.TimeSpan minBackoff, System.TimeSpan maxBackoff, double randomFactor) { }
public BackoffSupervisor(Akka.Actor.Props childProps, string childName, System.TimeSpan minBackoff, System.TimeSpan maxBackoff, Akka.Pattern.IBackoffReset reset, double randomFactor, Akka.Actor.SupervisorStrategy strategy) { }
public BackoffSupervisor(Akka.Actor.Props childProps, string childName, System.TimeSpan minBackoff, System.TimeSpan maxBackoff, Akka.Pattern.IBackoffReset reset, double randomFactor, Akka.Actor.SupervisorStrategy strategy, object replyWhileStopped = null) { }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this looked like a public breaking API change to me, but upon further review - this is actually calling an internal constructor belonging to the base class and can't be directly exposed to end users.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Aaronontheweb So it is considered a breaking change even when just adding optional parameters to a method signature?

@Aaronontheweb Aaronontheweb merged commit c0343e9 into akkadotnet:dev Jan 10, 2019
@Aaronontheweb
Copy link
Member

@ismaelhamed done!

@Aaronontheweb Aaronontheweb added this to the 1.3.12 milestone Jan 10, 2019
@Aaronontheweb
Copy link
Member

Aaronontheweb commented Jan 10, 2019 via email

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

Successfully merging this pull request may close these issues.

2 participants