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

JDK9 Flow integration #1783

Merged
merged 8 commits into from
Mar 13, 2020
Merged

JDK9 Flow integration #1783

merged 8 commits into from
Mar 13, 2020

Commits on Mar 5, 2020

  1. 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.
    dkhalanskyjb committed Mar 5, 2020
    Configuration menu
    Copy the full SHA
    3fff4a7 View commit details
    Browse the repository at this point in the history
  2. 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.
    dkhalanskyjb committed Mar 5, 2020
    Configuration menu
    Copy the full SHA
    f5b488a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    dafe32c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    abf2090 View commit details
    Browse the repository at this point in the history
  5. 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.
    dkhalanskyjb committed Mar 5, 2020
    Configuration menu
    Copy the full SHA
    97f9030 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    dd4a9dd View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    2a383c8 View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2020

  1. Fix

    dkhalanskyjb committed Mar 10, 2020
    Configuration menu
    Copy the full SHA
    0aa5989 View commit details
    Browse the repository at this point in the history