forked from Kotlin/kotlinx.coroutines
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Develop #7
Merged
Merged
Develop #7
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…1732) Flow.onCompletion now reports all failures and cancellation in its cause just like invokeOnCompletion. A null cause is reported if and only if flow had completed successfully (no failure, no cancellation). Emission of additional elements after the end of the flow is only possible from inside of onCompletion block in case of successful completion. Also fixed a bug where onCompletion implementation was trying to add exception to its own list of suppressed exceptions, which is not allowed. Fixes #1693
* Remove experimental annotation from Flow terminal and Channel operators * Remove experimental annotation from Flow count* and reduce* operators * Remove experimental annotation from Flow operations, including buffer and flowOn * Remove experimental annotation from combine and zip
This reverts commit 76e6440
* Kotlin DSL - 'android:example-app' (#1940) * 'android:example-app'. Gradle 5.6.1 - sync with root project * Kotlin DSL - 'android:example-app' * Kotlin DSL - 'android:animation-app' (#1941) * 'android:animation-app'. Gradle 5.6.1 - sync with root project * Kotlin DSL - 'android:animation-app' * Kotlin DSL - 'swing' (#1943) * Kotlin DSL - 'integration:jdk8' (#1944) * Kotlin DSL - 'test' (#1945) * Kotlin DSL - 'reactive:reactive' (#1946) * Kotlin DSL - 'android-unit-tests' * Use relative paths * Kotlin DSL - 'js-stub' (#1938) (#1959) * Kotlin DSL - 'android' (#1938) (#1956) * Kotlin DSL - 'stdlib-stubs' (#1938) (#1955) * Kotlin DSL - 'site' (#1938) (#1954) * Kotlin DSL - 'maven-central' (#1938) (#1953) * Kotlin DSL - 'benchmarks' (#1938) (#1952) Co-authored-by: Victor Turansky <victor.turansky@gmail.com>
* Use standard random API * Inline 'random' method
* Fix code formatting in doc example and make it more concise (both vertically and horizontally). * Don't promote custom `withTimeout` logic in examples. Use the actual `withTimeout` function. * Logical introduction of `context` parameter in docs (first use without it, then explain how it helps), consistent doc references. * Improved implementation in various places: * runInterruptibleInExpectedContext does not have to be suspend * There is always Job in the context * ThreadState should not do complex init in constructor (that's bad style) * ThreadState does not need inner State class, atomic int is enough * Consistent project-wide variable naming: state -> _state * Consistent use of `error` function to throw IllegalStateException
Spell-check & subject/body separation inspection
StateFlow is a Flow analogue to ConflatedBroadcastChannel. Since Flow API is simpler than channels APIs, the implementation of StateFlow is simpler. It consumes and allocates less memory, while still providing full deadlock-freedom (even though it is not lock-free internally). Fixes #1973 Fixes #395 Fixes #1816 Co-authored-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
Version 1.3.6
* Using Kotlin official style * Start imports for all packages * Continuation indent size = 4
* Restore java configuration for 'benchmarks' * Apply 'jmh' plugin after java configuration * Specify java.util.concurrent imports after migration to Java 11 * Remove duplicated dependency * Use release version of 'jmh' plugin. '0.5.0-rc-2' -> '0.5.0'
* It slightly cuts down startup time * It simplifies the code in general * It do not serve its purpose, coroutines are already protected from StackOverflowError with nested event-loops where applicable
* Update Gradle to 4.8.3, add space-dev repository * Update atomicfu and binary compatibility validator
* Merge onStartInternal and onStart to reduce the number of methods and make code a bit simpler * Rework initParentJob * Always establish a parent-child relationship when creating a subclass of AbstractCoroutine. That's our own internal class that we have full control of and it never has a chance to leak to the user-code (so cancellation handlers will be installed etc.). Force implementors of AbstractCoroutine deliberately choose whether parent-child relationship should be established * As a consequence, get rid of parentContext in all our coroutine classes that are not ScopeCoroutine * Remove some dead code * Get rid of an additional parent field from ScopeCoroutine Leverage already presented information in our implementation, just expose it via an already present internal interface
* Update SharedFlow documentation
* Rework reusability control in cancellable continuation * Update initCancellability documentation and implementation to be aligned with current invariants * Make parentHandle non-volatile and ensure there are no races around it * Establish new reusability invariants - Reusable continuation can be used _only_ if it states is not REUSABLE_CLAIMED - If it is, spin-loop and wait for release - Now the parent is attached to reusable continuation only if it was suspended at least once. Otherwise, the state machine can return via fast-path and no one will be able to release intercepted continuation (-> detach from parent) - It implies that the parent is attached after trySuspend call and can be concurrently reused, this is where new invariant comes into play * Leverage the fact that it's non-atomic and do not check it for cancellation prematurely. It increases the performance of fast-path, but potentially affects rare cancellation cases Fixes #2564
* Introduce three-state ChannelResult, a domain-specific Result class counterpart * Introduce receiveCatching/onReceiveCatching, make it public * Get rid of receiveOrClosed/onReceiveOrClosed without migrations, it was @InternalCoroutinesApi anyway Fixes #330
…cement for error-prone offer, poll and receiveOrNull Fixes #974
* Fix wrong docs on Job.join and Job.cancelAndJoin Fixes #2615
* Deprecation and migration of receiveOrNull and onReceiveOrNull. * Raise deprecation level for members, introduce deprecation for extensions * Explain rationale behind deprecation * Provide default implementation for deprecated members in Channel interface * Get rid of the internal implementation, leverage receiveCatching * Introduce new extensions for ChannelResult and use them as a replacement in our own operators Fixes #1676
The implementation of Reactive Streams' Subscriber used for `await*` operations was assuming that the publisher is correct. Now, the implementation detects some instances of problematic behavior for publishers and reports them. Fixes #2079
…entical 'ensureActive' extension to reduce code duplication (#2467)
* Remove all deprecated inline methods * Move the rest to the Deprecated.kt * Apply Deprecated.HIDDEN where possible, otherwise use internal + published API
* Remove all deprecated inline methods * Promote ERROR to HIDDEN where applicable * Promote WARNING to ERROR where applicable
* Embrace new channel API * Introduce trySendBlocking and deprecate sendBlocking * Use it in callbackFlow example * Stabilize callbackFlow and channelFlow as they finally have error-safe API * Irrelevant: migrate from deprecated stdlib API to be able to build with Kotlin 1.5 Co-authored-by: Roman Elizarov <elizarov@gmail.com>
* Otherwise Kotlin users with non-reactive background get confused by flow/stdlib inconsistency * Make it experimental to delay the final decision about the name Fixes #2641
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Merge with parent repo