-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
JDK9 Flow integration #1783
Merged
Merged
JDK9 Flow integration #1783
Commits on Mar 5, 2020
-
Implement Java9 reactive streams integration
This was accomplished by copying `kotlinx-coroutines-reactive`. Judging by the fact that https://github.com/reactive-streams/reactive-streams-jvm/blob/master/api/src/main/java9/org/reactivestreams/FlowAdapters.java defines converters between Java9 Flow and Reactive Streams as thin wrappers that simply redirect methods, this should be enough. Divergences from `kotlinx-coroutines-reactive` are as follows: * The target bytecode is set to JDK9. * JDK11 is required to build the module. * Automated change of all occurrences `org.reactivestreams` to `java.util.concurrent.Flow`. * Removal of `RangePublisherTest`, `RangePublisherBufferdTest`, and `UnboundedIntegerIncrementPublisherTest`. They all are heavily based on the examples provided for the Reactive Streams, and to use them for testing this integration would only be possible with heavy use of `FlowAdapters`, which seems redundant as the integration with the examples themselves is already tested in `kotlinx-coroutines-reactive`, and the correctness of the wrappers is probably a given. * Use of `FlowAdapters` where needed to make everything valid code.
Configuration menu - View commit details
-
Copy full SHA for 3fff4a7 - Browse repository at this point
Copy the full SHA 3fff4a7View commit details -
Remove deprecated methods from the Java Flow integration module
The `kotlinx-coroutines-jdk9` module, being a copy of `kotlinx-coroutines-reactive`, has its share of legacy APIs defined. As this is a new module, there is no reason to preserve them. The changes include: * `Migration.kt`, being a file completely dedicated to warnings about old API usage, has been removed. * `IntegrationTest.kt` changed slightly so that it no longer uses the subscription channel API, which is deprecated. * `Channel.kt` is now just an implementation detail. It does not expose any public methods. * In particular, `Publisher<T>.collect` has been moved to `ReactiveFlow.kt` and is no longer inline, as it would expose `openSubscription`, which is deprecated. * `PublisherSubscriptionSelectTest`, which tests use of `select` with the subscription channel API, is not included anymore. * `Convert.kt` also has been removed altogether, having no non-deprecated methods.
Configuration menu - View commit details
-
Copy full SHA for f5b488a - Browse repository at this point
Copy the full SHA f5b488aView commit details -
Configuration menu - View commit details
-
Copy full SHA for dafe32c - Browse repository at this point
Copy the full SHA dafe32cView commit details -
Configuration menu - View commit details
-
Copy full SHA for abf2090 - Browse repository at this point
Copy the full SHA abf2090View commit details -
Remove TCK tests from JDK9 Flow integration
Since the JDK9 Flow integration is now implemented as thin wrappers around the Reactive Streams integration, there is no need for such thorough testing, and additional tests would only cause the overhead of needing to fix two copies at once when changing the Reactive Streams integration.
Configuration menu - View commit details
-
Copy full SHA for 97f9030 - Browse repository at this point
Copy the full SHA 97f9030View commit details -
Configuration menu - View commit details
-
Copy full SHA for dd4a9dd - Browse repository at this point
Copy the full SHA dd4a9ddView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2a383c8 - Browse repository at this point
Copy the full SHA 2a383c8View commit details
Commits on Mar 10, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 0aa5989 - Browse repository at this point
Copy the full SHA 0aa5989View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.