aboutsummaryrefslogtreecommitdiffstats
path: root/kotlinx-coroutines-core/common/src/channels/ConflatedBroadcastChannel.kt
Commit message (Collapse)AuthorAgeFilesLines
* Mark BroadcastChannel, ConflatedBroadcastChannel and all related oper… (#2647)Vsevolod Tolstopyatov2021-04-151-3/+3
| | | | | | * Mark BroadcastChannel, ConflatedBroadcastChannel and all related operators as obsolete API replaced with SharedFlow and StateFlow * Remove operator fusion with deprecated broadcastIn in order to simplify further Flow maintenance
* Deprecate SendChannel.offer and ReceiveChannel.poll, replace their usages ↵Vsevolod Tolstopyatov2021-04-131-1/+1
| | | | | | | | | | along the codebase (#2644) * Deprecate SendChannel.offer and replace its usages along the codebase * Deprecate ReceiveChannel.poll and replace its usages along the codebase Co-authored-by: Roman Elizarov <elizarov@gmail.com> Addresses #974
* Remove deprecated SendChannel.isFull (#2613)Vsevolod Tolstopyatov2021-04-061-1/+0
|
* Introduce trySend and tryReceive channel operations as a future replacement ↵Vsevolod Tolstopyatov2021-03-251-5/+5
| | | | | | for error-prone offer, poll and receiveOrNull Fixes #974
* Update copyright year (#2520)Vsevolod Tolstopyatov2021-02-041-1/+1
|
* Introduce SharedFlow and sharing operators (#2069)Roman Elizarov2020-10-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Introduce SharedFlow and sharing operators Summary of changes: * SharedFlow, MutableSharedFlow and its constructor. * StateFlow implements SharedFlow. * SharedFlow.onSubscription operator, clarified docs in other onXxx operators. * BufferOverflow strategy in kotlinx.coroutines.channels package. * shareIn and stateIn operators and SharingStarted strategies for them. * SharedFlow.flowOn error lint (up from StateFlow). * Precise cancellable() operator fusion. * Precise distinctUntilChanged() operator fusion. * StateFlow.compareAndSet function. * asStateFlow and asSharedFlow read-only view functions. * Consistently clarified docs on cold vs hot flows. * Future deprecation notice for BroadcastChannel, ConflatedBroadcastChannel, broadcast, and broadcastIn. * Channel(...) constructor function has onBufferOverflow parameter. * buffer(...) operator has onBufferOverflow parameter. * shareIn/stateIn buffer and overflow strategy are configured via upstream buffer operators. * shareIn/stateIn fuse with upstream flowOn for more efficient execution. * conflate() is implemented as buffer(onBufferOverflow=KEEP_LATEST), non-suspending strategies are reasonably supported with 0 and default capacities. * Added reactive operator migration hints. * WhileSubscribed with kotlin.time.Duration params Fixes #2034 Fixes #2047 Co-authored-by: Ibraheem Zaman <1zaman@users.noreply.github.com> Co-authored-by: Thomas Vos <thomasjsvos@gmail.com> Co-authored-by: Travis Wyatt <travis.i.wyatt@gmail.com>
* Breaking: Get rid of atomic cancellation and provide a replacement (#1937)Roman Elizarov2020-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a problematic for Android when Main dispatcher is cancelled on destroyed activity. Atomic nature of channels is designed to prevent loss of elements, which is really not an issue for a typical application, but creates problem when used with channels. * Internal suspendAtomicCancellableCoroutine -> suspendCancellableCoroutine * Internal suspendAtomicCancellableCoroutineReusable -> suspendCancellableCoroutineReusable * Remove atomic cancellation from docs * Ensures that flowOn does not resume downstream after cancellation. * MODE_ATOMIC_DEFAULT renamed into MODE_ATOMIC * Introduced MODE_CANCELLABLE_REUSABLE to track suspendCancellableCoroutineReusable * Better documentation for MODE_XXX constants. * Added stress test for proper handling of MODE_CANCELLABLE_REUSABLE and fixed test for #1123 bug with job.join (working in MODE_CANCELLABLE) that was not properly failing in the absence of the proper code in CancellableContinuationImpl.getResult * Added test for Flow.combine that should be fixed * Support extended invokeOnCancellation contract * Introduced internal tryResumeAtomic * Channel onUnderliveredElement is introduced as a replacement. Fixes #1265 Fixes #1813 Fixes #1915 Fixes #1936 Co-authored-by: Louis CAD <louis.cognault@gmail.com> Co-authored-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
* Merge remote-tracking branch 'origin/master' into developRoman Elizarov2020-03-311-2/+0
|\
| * Removed extra non working SharedImmutable annotations (#1892)LepilkinaElena2020-03-311-2/+0
| |
* | Enable strict explicit mode (#1877)Vsevolod Tolstopyatov2020-03-271-1/+1
|/
* Fixed regularized 'when' inference to build trainRoman Elizarov2020-03-031-1/+1
| | | | See https://youtrack.jetbrains.com/issue/KT-36776
* Update copyright yearVsevolod Tolstopyatov2020-02-181-1/+1
|
* Use common SharedImmutable declaration from stdlibRoman Elizarov2019-12-181-0/+1
|
* Eagerly create cancellation exception during Job.cancel call to make ↵Vsevolod Tolstopyatov2019-10-041-1/+1
| | | | | | stacktrace even shorter Also, fix stacktrace recovery in select clause
* Fix StackOverflowException with select expressionsRoman Elizarov2019-09-211-1/+1
| | | | | | | | | | | | | * onSend/onReceive clauses on the same channel: Instead of StackOverflowError we throw IllegalStateException and leave the channel in the original state. * Fix SOE in select with "opposite channels" stress-test. The fix is based on the sequential numbering of atomic select operation. Deadlock is detected and the operation with the lower sequential number is aborted and restarted (with a larger number). Fixes #504 Fixes #1411
* Make ReceiveChannel.cancel linearizability-friendlyVsevolod Tolstopyatov2019-09-181-3/+5
|
* Rewrite assertions so that they are checked only in debug modeRoman Elizarov2019-07-021-2/+2
| | | | | * Make sure assertions are absent on native and JS * Only print full toString for Job in debug mode
* Replace hand-rolled arraycopy with stdlib copyIntoLouis CAD2019-06-301-2/+9
|
* Consolidate NullSurrogate with Symbol and rename it to NULLRoman Elizarov2019-05-311-11/+4
| | | | | * JvmStatic on unbox did not make sense anyway * unbox is useful for other symbols
* Added clarification on deprecation version in code, better CE messagesRoman Elizarov2019-03-061-1/+1
|
* Hide cancel(Throwable), introduce cancel(CancellationException)Roman Elizarov2019-03-011-3/+15
| | | | | | | | | | | Job/ReceiveChannel/BroadcastChannel.cancel(Throwable) is now hidden and cannot be invoked from a newly compiled code. This function had broken semantics when used with an arbitrary exception. A safe replacement is available in the form of cancel(CancellationException) where CancellationException can be used to supply additional information for debugging purposes. Fixes #975
* Migration to new multiplatorm plugin (#947)Vsevolod Tolstopyatov2019-01-281-0/+282
Migration to a new multiplatform plugin * kotlinx-coroutines-core-[common|js|native] are merged into one core module with multiple source sets * Folder structure and readme are restructured * Publication process is patched to preserve backward compatibility with artifact names