-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Bring UnfoldResourceSourceAsync up-to-date #5052
Bring UnfoldResourceSourceAsync up-to-date #5052
Conversation
@@ -930,7 +930,7 @@ public static class Source | |||
/// <param name="close">function that closes resource</param> | |||
/// <returns>TBD</returns> | |||
public static Source<T, NotUsed> UnfoldResourceAsync<T, TSource>(Func<Task<TSource>> create, | |||
Func<TSource, Task<Option<T>>> read, Func<TSource, Task> close) | |||
Func<TSource, Task<Option<T>>> read, Func<TSource, Task<Done>> close) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change, but the signature was wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big deal, IMHO
/// </summary> | ||
/// <param name="source">TBD</param> | ||
/// <param name="f">The function to be executed when this Task completes</param> | ||
public static Task OnComplete(this Task source, Action<Try<Done>> f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand these extensions are not idiomatic in C#, but working with ContinueWith
is cumbersome when you have to repeat a chunk of code like this one over and over again.
Maybe porting more of these extensions from the JVM wouldn't be such a bad idea after all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This stuff is all marked as part of our internal APIs anyways - so users shouldn't expect that this would be part of the public-facing API that we preserve. If these make things easier, we should include them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -930,7 +930,7 @@ public static class Source | |||
/// <param name="close">function that closes resource</param> | |||
/// <returns>TBD</returns> | |||
public static Source<T, NotUsed> UnfoldResourceAsync<T, TSource>(Func<Task<TSource>> create, | |||
Func<TSource, Task<Option<T>>> read, Func<TSource, Task> close) | |||
Func<TSource, Task<Option<T>>> read, Func<TSource, Task<Done>> close) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big deal, IMHO
/// </summary> | ||
/// <param name="source">TBD</param> | ||
/// <param name="f">The function to be executed when this Task completes</param> | ||
public static Task OnComplete(this Task source, Action<Try<Done>> f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This stuff is all marked as part of our internal APIs anyways - so users shouldn't expect that this would be part of the public-facing API that we preserve. If these make things easier, we should include them.
Really appreciate you dealing with the racy specs in particular. We need to do a lot more of that on the Akka.Streams test suite still unfortunately. |
No description provided.