├── .gitignore ├── ui ├── kotlinx-coroutines-android │ ├── example-app │ │ ├── settings.gradle │ │ ├── .gitignore │ │ ├── app │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── res │ │ │ │ │ ├── values │ │ │ │ │ │ ├── dimens.xml │ │ │ │ │ │ ├── strings.xml │ │ │ │ │ │ ├── colors.xml │ │ │ │ │ │ └── styles.xml │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── menu │ │ │ │ │ │ └── menu_main.xml │ │ │ │ │ └── layout │ │ │ │ │ │ ├── content_main.xml │ │ │ │ │ │ └── activity_main.xml │ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── app │ │ │ │ │ └── MainActivity.kt │ │ │ ├── proguard-rules.pro │ │ │ └── build.gradle │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── build.gradle │ │ └── gradle.properties │ └── README.md ├── ui-example-javafx.png ├── ui-example-android.png ├── kotlinx-coroutines-swing │ ├── README.md │ └── src │ │ └── test │ │ └── kotlin │ │ ├── kotlinx │ │ └── coroutines │ │ │ └── experimental │ │ │ └── swing │ │ │ └── SwingTest.kt │ │ └── examples │ │ ├── swing-example.kt │ │ └── SwingExampleApp.kt ├── kotlinx-coroutines-javafx │ ├── README.md │ ├── pom.xml │ └── src │ │ └── test │ │ └── kotlin │ │ └── guide │ │ └── example-ui-basic-01.kt └── README.md ├── site ├── docs │ ├── _includes │ │ ├── footer.html │ │ ├── header.html │ │ └── head.html │ ├── _config.yml │ ├── _layouts │ │ └── api.html │ ├── Gemfile │ ├── _sass │ │ ├── _layout.scss │ │ └── _minima.scss │ ├── assets │ │ └── main.scss │ ├── index.md │ └── Gemfile.lock └── README.md ├── kotlinx-coroutines-nio ├── README.md ├── src │ └── test │ │ └── kotlin │ │ └── examples │ │ └── log.kt └── pom.xml ├── license ├── NOTICE.txt ├── LICENSE.txt └── third_party │ └── minima_LICENSE.txt ├── knit └── README.md ├── reactive ├── README.md ├── kotlinx-coroutines-reactor │ └── src │ │ ├── test │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── coroutines │ │ │ └── experimental │ │ │ └── reactor │ │ │ ├── Check.kt │ │ │ ├── SchedulerTest.kt │ │ │ └── FluxCompletionStressTest.kt │ │ └── main │ │ └── kotlin │ │ └── kotlinx │ │ └── coroutines │ │ └── experimental │ │ └── reactor │ │ ├── Flux.kt │ │ └── Convert.kt ├── kotlinx-coroutines-rx2 │ └── src │ │ ├── test │ │ └── kotlin │ │ │ ├── guide │ │ │ ├── example-reactive-basic-06.kt │ │ │ ├── example-reactive-operators-01.kt │ │ │ ├── example-reactive-basic-04.kt │ │ │ ├── example-reactive-basic-07.kt │ │ │ ├── example-reactive-context-01.kt │ │ │ ├── example-reactive-context-02.kt │ │ │ ├── example-reactive-context-04.kt │ │ │ ├── example-reactive-basic-08.kt │ │ │ ├── example-reactive-basic-03.kt │ │ │ ├── example-reactive-basic-09.kt │ │ │ ├── example-reactive-context-03.kt │ │ │ ├── example-reactive-basic-01.kt │ │ │ ├── example-reactive-context-05.kt │ │ │ ├── example-reactive-basic-02.kt │ │ │ ├── example-reactive-basic-05.kt │ │ │ ├── example-reactive-operators-02.kt │ │ │ └── example-reactive-operators-04.kt │ │ │ └── kotlinx │ │ │ └── coroutines │ │ │ └── experimental │ │ │ └── rx2 │ │ │ ├── SchedulerTest.kt │ │ │ ├── ObservableCompletionStressTest.kt │ │ │ └── Check.kt │ │ └── main │ │ └── kotlin │ │ └── kotlinx │ │ └── coroutines │ │ └── experimental │ │ └── rx2 │ │ └── RxFlowable.kt ├── kotlinx-coroutines-rx1 │ ├── src │ │ └── test │ │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── coroutines │ │ │ └── experimental │ │ │ └── rx1 │ │ │ ├── Check.kt │ │ │ └── ObservableCompletionStressTest.kt │ └── pom.xml └── kotlinx-coroutines-reactive │ └── src │ ├── main │ └── kotlin │ │ └── kotlinx │ │ └── coroutines │ │ └── experimental │ │ └── reactive │ │ └── Convert.kt │ └── test │ └── kotlin │ └── kotlinx │ └── coroutines │ └── experimental │ └── reactive │ ├── PublisherMultiTest.kt │ └── PublisherCompletionStressTest.kt ├── kotlinx-coroutines-jdk8 ├── src │ └── test │ │ └── kotlin │ │ └── examples │ │ ├── log.kt │ │ ├── ToFuture-example.kt │ │ ├── CancelFuture-example.kt │ │ ├── simple-example-1.kt │ │ ├── simple-example-2.kt │ │ ├── Try.kt │ │ ├── simple-example-3.kt │ │ ├── ExplicitJob-example.kt │ │ └── withTimeout-example.kt ├── pom.xml └── README.md └── kotlinx-coroutines-core └── src ├── main └── kotlin │ └── kotlinx │ └── coroutines │ └── experimental │ ├── internal │ └── Symbol.kt │ ├── selects │ └── WhileSelect.kt │ ├── channels │ ├── ChannelCoroutine.kt │ ├── RendezvousChannel.kt │ ├── Channels.kt │ └── BroadcastChannel.kt │ ├── CoroutineName.kt │ ├── LazyDeferred.kt │ ├── Yield.kt │ └── intrinsics │ └── Undispatched.kt └── test └── kotlin ├── guide ├── example-context-05.kt ├── example-cancel-06.kt ├── example-basic-06.kt ├── example-basic-04.kt ├── example-basic-03.kt ├── example-basic-05.kt ├── example-channel-03.kt ├── example-basic-02.kt ├── example-context-04.kt ├── example-basic-01.kt ├── example-context-03.kt ├── example-channel-02.kt ├── example-cancel-01.kt ├── example-channel-01.kt ├── example-channel-08.kt ├── example-channel-07.kt ├── example-cancel-04.kt ├── example-context-08.kt ├── example-compose-01.kt ├── example-compose-02.kt ├── example-cancel-02.kt ├── example-channel-06.kt ├── example-cancel-03.kt ├── example-compose-03.kt ├── example-context-02.kt ├── example-channel-05.kt ├── example-channel-09.kt ├── example-channel-04.kt ├── example-cancel-05.kt ├── example-sync-01.kt ├── example-context-09.kt ├── example-context-07.kt ├── example-sync-02.kt ├── example-sync-03.kt ├── example-context-01.kt ├── example-select-04.kt ├── example-sync-05.kt ├── example-sync-06.kt ├── example-select-03.kt ├── example-sync-04.kt ├── example-select-02.kt ├── example-context-06.kt ├── example-select-01.kt └── example-compose-04.kt └── kotlinx └── coroutines └── experimental ├── Try.kt ├── selects ├── SelectTimeoutTest.kt └── SelectBiasTest.kt ├── TestBase.kt └── LaunchLazyTest.kt /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | *.iml 3 | target -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /site/docs/_includes/footer.html: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /ui/ui-example-javafx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pljp/kotlinx.coroutines/HEAD/ui/ui-example-javafx.png -------------------------------------------------------------------------------- /ui/ui-example-android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pljp/kotlinx.coroutines/HEAD/ui/ui-example-android.png -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/.gitignore: -------------------------------------------------------------------------------- 1 | local.properties 2 | .gradle 3 | .idea 4 | build 5 | example-app.iml 6 | app/build 7 | app/app.iml 8 | -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16dp 3 | 4 | -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pljp/kotlinx.coroutines/HEAD/ui/kotlinx-coroutines-android/example-app/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ExampleApp 3 | Settings 4 | 5 | -------------------------------------------------------------------------------- /site/docs/_includes/header.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pljp/kotlinx.coroutines/HEAD/ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pljp/kotlinx.coroutines/HEAD/ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pljp/kotlinx.coroutines/HEAD/ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pljp/kotlinx.coroutines/HEAD/ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pljp/kotlinx.coroutines/HEAD/ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pljp/kotlinx.coroutines/HEAD/ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pljp/kotlinx.coroutines/HEAD/ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pljp/kotlinx.coroutines/HEAD/ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pljp/kotlinx.coroutines/HEAD/ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pljp/kotlinx.coroutines/HEAD/ui/kotlinx-coroutines-android/example-app/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /site/docs/_config.yml: -------------------------------------------------------------------------------- 1 | # Jekyll configuration file 2 | title: kotlinx.coroutines 3 | description: Library support for kotlin coroutines 4 | baseurl: "/kotlinx.coroutines" 5 | url: "https://kotlin.github.io" 6 | 7 | # Build settings 8 | markdown: kramdown 9 | exclude: 10 | - Gemfile 11 | - Gemfile.lock 12 | -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /site/docs/_layouts/api.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% include head.html %} 4 | 5 | {% include header.html %} 6 |
7 |
8 | {{ content }} 9 |
10 |
11 | {% include footer.html %} 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /site/README.md: -------------------------------------------------------------------------------- 1 | # Reference documentation site 2 | 3 | This module builds references documentation. 4 | 5 | ## Building 6 | 7 | * Install [Jekyll](http://jekyllrb.com) 8 | * In project root directory do: 9 | * Run `mvn clean` 10 | * Run `mvn compile` 11 | * Run `mvn site` 12 | * The result is in `target/_site` 13 | * Upload it to github pages (`gh-pages` branch) 14 | -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/README.md: -------------------------------------------------------------------------------- 1 | # Module kotlinx-coroutines-android 2 | 3 | Provides `UI` context for Android applications. 4 | 5 | Read [Guide to UI programming with coroutines](https://github.com/Kotlin/kotlinx.coroutines/blob/master/ui/coroutines-guide-ui.md) 6 | for tutorial on this module. 7 | 8 | # Package kotlinx.coroutines.experimental.android 9 | 10 | Provides `UI` context for Android applications. 11 | -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-swing/README.md: -------------------------------------------------------------------------------- 1 | # Module kotlinx-coroutines-swing 2 | 3 | Provides `Swing` context for Swing UI applications. 4 | 5 | Read [Guide to UI programming with coroutines](https://github.com/Kotlin/kotlinx.coroutines/blob/master/ui/coroutines-guide-ui.md) 6 | for tutorial on this module. 7 | 8 | # Package kotlinx.coroutines.experimental.swing 9 | 10 | Provides `Swing` context for Swing UI applications. 11 | -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-javafx/README.md: -------------------------------------------------------------------------------- 1 | # Module kotlinx-coroutines-javafx 2 | 3 | Provides `JavaFx` context for JavaFX UI applications. 4 | 5 | Read [Guide to UI programming with coroutines](https://github.com/Kotlin/kotlinx.coroutines/blob/master/ui/coroutines-guide-ui.md) 6 | for tutorial on this module. 7 | 8 | # Package kotlinx.coroutines.experimental.javafx 9 | 10 | Provides `JavaFx` context for JavaFX UI applications. 11 | -------------------------------------------------------------------------------- /kotlinx-coroutines-nio/README.md: -------------------------------------------------------------------------------- 1 | # Module kotlinx-coroutines-nio 2 | 3 | Extensions for asynchronous IO on JDK7+. 4 | 5 | # Package kotlinx.coroutines.experimental.nio 6 | 7 | Extensions for asynchronous IO on JDK7+. 8 | 9 | * `AsynchronousFileChannel` extensions `aLock`, `aRead`, and `aWrite`. 10 | * `AsynchronousServerSocketChannel` extension `aAccept`. 11 | * `AsynchronousSocketChannel` extensions `aConnect`, `aRead`, and `aWrite`. 12 | -------------------------------------------------------------------------------- /ui/README.md: -------------------------------------------------------------------------------- 1 | # Coroutines for UI 2 | 3 | This directory contains modules for coroutine programming with various single-threaded UI libraries: 4 | 5 | ## Modules 6 | 7 | * [kotlinx-coroutines-android](kotlinx-coroutines-android) -- `UI` context for Android applications. 8 | * [kotlinx-coroutines-javafx](kotlinx-coroutines-javafx) -- `JavaFx` context for JavaFX UI applications. 9 | * [kotlinx-coroutines-swing](kotlinx-coroutines-swing) -- `Swing` context for Swing UI applications. 10 | -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /license/NOTICE.txt: -------------------------------------------------------------------------------- 1 | ========================================================================= 2 | == NOTICE file corresponding to the section 4 d of == 3 | == the Apache License, Version 2.0, == 4 | == in this case for the kotlix.coroutines library. == 5 | ========================================================================= 6 | 7 | kotlinx.coroutines library. 8 | Copyright 2016-2017 JetBrains s.r.o and respective authors and developers 9 | -------------------------------------------------------------------------------- /knit/README.md: -------------------------------------------------------------------------------- 1 | # Knit 2 | 3 | This is a very simple tool that produces Kotlin source example files from a markdown document that includes 4 | snippets of Kotlin code in its body. It is used to produce examples for 5 | [coroutines guide](../coroutines-guide.md). 6 | 7 | ## Updating guide 8 | 9 | * In project root directory do: 10 | * Run `mvn clean` 11 | * Run `mvn compile` 12 | * Run `mvn pre-site` (or `mvn site` if you have Jekyll) 13 | * Run `Knit coroutines-guide.md` (from IDEA, mark `knit/src` as source root first) 14 | * Commit updated `coroutines-guide.md` and examples 15 | 16 | -------------------------------------------------------------------------------- /site/docs/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | ruby RUBY_VERSION 3 | 4 | # Hello! This is where you manage which Jekyll version is used to run. 5 | # When you want to use a different version, change it below, save the 6 | # file and run `bundle install`. Run Jekyll with `bundle exec`, like so: 7 | # 8 | # bundle exec jekyll serve 9 | # 10 | # This will help ensure the proper Jekyll version is running. 11 | # Happy Jekylling! 12 | 13 | gem "jekyll", "3.4.0" 14 | 15 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem 16 | gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 17 | -------------------------------------------------------------------------------- /reactive/README.md: -------------------------------------------------------------------------------- 1 | # Coroutines for reactive streams 2 | 3 | This directory contains modules with utilities for various reactive stream libraries: 4 | 5 | ## Modules 6 | 7 | * [kotlinx-coroutines-reactive](kotlinx-coroutines-reactive) -- utilities for [Reactive Streams](http://www.reactive-streams.org) 8 | * [kotlinx-coroutines-reactor](kotlinx-coroutines-reactor) -- utilities for [Reactor](https://projectreactor.io) 9 | * [kotlinx-coroutines-rx1](kotlinx-coroutines-rx1) -- utilities for [RxJava 1.x](https://github.com/ReactiveX/RxJava/tree/1.x) 10 | * [kotlinx-coroutines-rx2](kotlinx-coroutines-rx2) -- utilities for [RxJava 2.x](https://github.com/ReactiveX/RxJava) 11 | -------------------------------------------------------------------------------- /license/LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2017 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext.kotlin_version = '1.1.2' 5 | repositories { 6 | jcenter() 7 | } 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:2.3.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | 12 | // NOTE: Do not place your application dependencies here; they belong 13 | // in the individual module build.gradle files 14 | } 15 | } 16 | 17 | allprojects { 18 | repositories { 19 | jcenter() 20 | } 21 | } 22 | 23 | task clean(type: Delete) { 24 | delete rootProject.buildDir 25 | } 26 | -------------------------------------------------------------------------------- /ui/kotlinx-coroutines-android/example-app/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 |