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

Bring UnfoldResourceSourceAsync up-to-date #5052

Merged
merged 2 commits into from
Jun 1, 2021

Conversation

ismaelhamed
Copy link
Member

No description provided.

@@ -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)
Copy link
Member Author

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.

Copy link
Member

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)
Copy link
Member Author

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.

Copy link
Member

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.

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

@@ -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)
Copy link
Member

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)
Copy link
Member

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.

@Aaronontheweb Aaronontheweb enabled auto-merge (squash) June 1, 2021 17:20
@Aaronontheweb
Copy link
Member

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.

@Aaronontheweb Aaronontheweb merged commit f6da797 into akkadotnet:dev Jun 1, 2021
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