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

chore: Refactor UnfoldResourceSourceAsync. #1240

Merged
merged 1 commit into from
Apr 15, 2024
Merged

Conversation

He-Pin
Copy link
Member

@He-Pin He-Pin commented Mar 29, 2024

Motivation:
Refactory UnfoldResourceSourceAsync without change the order of type parameter instead of #616

Result:
Clean code and less allocation.

I think we should this when reading the code in #1240

@He-Pin He-Pin added the t:stream Pekko Streams label Mar 29, 2024
@He-Pin He-Pin added this to the 1.1.0-M1 milestone Apr 1, 2024

private val createdCallback = getAsyncCallback[Try[S]] {
case Success(resource) =>
require(resource != null, "`create` method should not return a null resource.")
Copy link
Member Author

Choose a reason for hiding this comment

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

the resource can be null, but can not now.
I think no one will returning a null resource

Maybe we should do the same in unfoldResource

Copy link
Member

@Roiocam Roiocam left a comment

Choose a reason for hiding this comment

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

LGTM

@He-Pin
Copy link
Member Author

He-Pin commented Apr 14, 2024

Thanks for the review

@He-Pin He-Pin merged commit 55f065f into main Apr 15, 2024
18 checks passed
@He-Pin He-Pin deleted the unfoldResourceAsync branch April 15, 2024 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t:stream Pekko Streams
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants