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

Minor documentation additions - Akka Streams RestartFlow and RestartSettings #6820

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/Akka.Streams/Dsl/RestartFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public static Flow<TIn, TOut, NotUsed> OnFailuresWithBackoff<TIn, TOut, TMat>(Fu
/// <para>This uses the same exponential backoff algorithm as <see cref="BackoffOptions"/>.</para>
/// </summary>
/// <param name="flowFactory">A factory for producing the <see cref="Flow"/>] to wrap.</param>
/// <param name="settings"></param>
/// <param name="settings"><see cref="RestartSettings" /> defining restart configuration</param>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Matching the documentation for the WithBackoff method in this class

public static Flow<TIn, TOut, NotUsed> OnFailuresWithBackoff<TIn, TOut, TMat>(Func<Flow<TIn, TOut, TMat>> flowFactory, RestartSettings settings)
=> Flow.FromGraph(new RestartWithBackoffFlow<TIn, TOut, TMat>(flowFactory, settings, onlyOnFailures: true));
}
Expand Down
6 changes: 6 additions & 0 deletions src/core/Akka.Streams/RestartSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ private RestartSettings(TimeSpan minBackoff, TimeSpan maxBackoff, double randomF
MaxRestartsWithin = maxRestartsWithin;
}

/// <summary>
/// Creates a new instance of <see cref="RestartSettings"/> class
/// </summary>
/// <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>
Comment on lines +29 to +34
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addition of documentation matching the extension methods in the class

public static RestartSettings Create(TimeSpan minBackoff, TimeSpan maxBackoff, double randomFactor) =>
new(minBackoff, maxBackoff, randomFactor, int.MaxValue, minBackoff);

Expand Down