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

Issue #1316: Kotlin - Remove unnecessary suspend modifier from asFlow and Uni builder #1323

Merged
merged 2 commits into from
Jul 25, 2023

Conversation

heubeck
Copy link
Collaborator

@heubeck heubeck commented Jul 24, 2023

Tries to solve #1316
Fixes #1324

@hantsy, you're right, the suspend modifier is not needed for asFlow.
Your referenced implementation of kotlinx-coroutines-reactive would required an additional dependency, that's why I would prefer to stay with the own implementation, especially as it's also capable of buffer handling.

@codecov
Copy link

codecov bot commented Jul 24, 2023

Codecov Report

Merging #1323 (4a9585f) into main (56848d6) will increase coverage by 0.24%.
The diff coverage is 100.00%.

❗ Current head 4a9585f differs from pull request most recent head a05c525. Consider uploading reports for the commit a05c525 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1323      +/-   ##
============================================
+ Coverage     89.66%   89.90%   +0.24%     
- Complexity     3347     3359      +12     
============================================
  Files           459      459              
  Lines         13327    13327              
  Branches       1656     1656              
============================================
+ Hits          11950    11982      +32     
+ Misses          720      695      -25     
+ Partials        657      650       -7     
Files Changed Coverage Δ
...main/kotlin/io/smallrye/mutiny/coroutines/Multi.kt 91.17% <100.00%> (ø)
...c/main/kotlin/io/smallrye/mutiny/coroutines/Uni.kt 100.00% <100.00%> (ø)

... and 14 files with indirect coverage changes

@hantsy
Copy link

hantsy commented Jul 25, 2023

Your referenced implementation of kotlinx-coroutines-reactive would required an additional dependency, that's why I would prefer to stay with the own implementation, especially as it's also capable of buffer handling.

For developers, I would like get the similar experience between different impelementations.

If possible to move this mutiny kotlin to kotlinx-coroutines/reactive project as a new module kotlinx-coroutines-mutiny?

@heubeck
Copy link
Collaborator Author

heubeck commented Jul 25, 2023

If possible to move the mutiny to kotlinx-coroutines/reactive project as a new module kotlinx-coroutines-mutiny?

that's indeed an interesting idea. would be trade of between convenience with the other coroutine-reactive extensions, but on the other side, add complexity as that requires separate versioning.

In fact, I would like to keep the implementation here, but how about adding a kotlinx-coroutines-mutiny module, that includes mutiny-kotlin and just provides aliases?

@hantsy
Copy link

hantsy commented Jul 25, 2023

that's indeed an interesting idea. would be trade of between convenience with the other coroutine-reactive extensions, but on the other side, add complexity as that requires separate versioning.

In fact, I would like to keep the implementation here, but how about adding a kotlinx-coroutines-mutiny module, that includes mutiny-kotlin and just provides aliases?

  1. keep current mutiny-kotlin as maintenance status.
  2. contribute new kotlinx-coroutines-mutiny module and reuse the existing work under the kotlinx-coroutines/reactive to simplify the development, and use the same version there. I think it is good to advertise Mutiny.

Mutiny implements JDK 9 Flow, currently I think we can use kotlinx-coroutines-jdk9 for Flow.Publisher.

@heubeck heubeck changed the title Issue #1316: Kotlin - Remove unnecessary suspend modifier from asFlow Issue #1316: Kotlin - Remove unnecessary suspend modifier from asFlow and Uni builder Jul 25, 2023
@heubeck
Copy link
Collaborator Author

heubeck commented Jul 25, 2023

Thank you, @hantsy, will become familiar with the existing coroutine-reactive implementations and consider your proposal.
As mutiny-kotlin provides (at least some) non coroutine related extensions, it will stay in any case for those.
I see the value of having mutiny included in coroutine-reactive also from a marketing perspective, though.

@heubeck
Copy link
Collaborator Author

heubeck commented Jul 25, 2023

discussion about coroutines-reactive-mutiny to be followed up in #1325

@jponge
Copy link
Member

jponge commented Jul 25, 2023

Let's put this one on hold until we have a clear view on the next steps in #1325

@heubeck
Copy link
Collaborator Author

heubeck commented Jul 25, 2023

Let's put this one on hold until we have a clear view on the next steps in #1325

This PR is not directly related with #1325, it's an improvement in general.

@jponge jponge added the enhancement New feature or request label Jul 25, 2023
@jponge jponge added this to the 2.4.0 milestone Jul 25, 2023
Copy link
Member

@jponge jponge left a comment

Choose a reason for hiding this comment

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

Ok, thanks @heubeck 👍

@jponge jponge merged commit 13b879d into main Jul 25, 2023
@jponge jponge deleted the issue-1316 branch July 25, 2023 14:42
@jponge jponge modified the milestones: 2.4.0, 2.4.0-RC1 Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Seemingly unnecessary suspend modifier on uni coroutine builder
3 participants