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

Update cooroutines #1

Merged
merged 69 commits into from
Jun 8, 2019
Merged

Update cooroutines #1

merged 69 commits into from
Jun 8, 2019

Conversation

adibfara
Copy link
Owner

@adibfara adibfara commented Jun 8, 2019

No description provided.

qwwdfsad and others added 30 commits April 26, 2019 13:16
…les like webpack configs may become corrupted
…1158)

* Fix exception types for channels to ensure transparency & reporting

* ReceiveChannel.cancel always closes channel with CancellationException,
  so sending or receiving from a cancelled channel produces the
  corresponding CancellationException.
* Cancelling produce builder has similar effect, but an more specific
  instance of JobCancellationException is created.
* This ensure that produce/consumeEach pair is transparent with respect
  to cancellation and can be used to build "identity" transformation
  of the flow (the corresponding test is added).
* ClosedSendChannelException is now a subclass of IllegalStateException,
  so that trying to send to a channel that was closed normally is
  reported as program error and is not eaten (test is added).

Fixes #957
Fixes #1128

* Exceptions for channels cleanup

    * Documentation improved
    * Better exception message
    * Simplified flowOn implementation
    * Avoid exception instantiation on happy path in zip
* Removed #1130 workaround from debounce
* Fixed race in debounce

Fixes #1130
#1154)

* Fix more typos; reword some phrases; add "job:" to textual output in examples
to better differentiate between the "main" and "job" coroutines
* Gradle knit
* Updated to 0.12.7 version of atmoicfu with fixes.
* Added test that that is no references to atomicfu in any of the
  resulting class files.

Fixes #1155
* Fixed typos
* Added reference to kotlinx-coroutines-test for testing `Main` dispatcher
…id dependency on (frequently) unstable external JavaDoc resources

Fixes #648
…able).

    * Reasoning about cancellation is simplified in sequential scenarios, if 'cancel' was invoked before withContext return it will throw an exception, thus "isActive == false" cannot be observed in sequential scenarios after cancellation
    * withContext now complies its own documentation

Fixes #1177
…lect, transform, map, mapNotNull, filter, filterNot, filterNotNull) as inline
    * It is not that useful in an application code (-> is extracted into method), so won't bloat bytecode too much
    * It is crucial enough as building block to avoid excess allocations
    * Additionally mark inlined builders with labeled return to workaround KT-28938
    * RxJava2 by David Karnok
    * FlowPlaysScrabbleBase and FlowPlaysScrabbleOpt as flow counterparts
    * Lower bounds for Flow scrabble benchmark
* Mark ReceiveChannel.map with @ObsoleteCoroutinesApi

Fixes #1162
only 100 coroutines get started not 1000.
qwwdfsad and others added 28 commits May 29, 2019 21:27
SafeCollector performance improvements:
* Cache result of the context check thus speeding up safe collector on happy path by a factor of three
* Separate fast and slow paths in JobSupport to drastically change inlining decisions of the JVM that are crucial for leaf coroutines with flows

Strengthen flow context preservation invariant

* Add additional check in SafeCollector with an error message pointing to channelFlow
* Improve performance of the CoroutineId check in SafeCollector
* Change wording in documentation

Fixes #1210
* JvmStatic on unbox did not make sense anyway
* unbox is useful for other symbols
* Improve MainCoroutineDispatcher.immediate documentation
* Remove obsolete readme and package descriptions
* Clarify possible replacement of onCompletion parameter in produce
* Add paragraph about parent cancellation to async (Mention structured concurrency, but do not explain it there as the term should be easily googlable).

Fixes #1219
Fixes #994 
Fixes #787
… dispatchers.

Use Promise.resolve and process.nextTick as dispatch mechanism for cold starts
The developer still has to disable the FastServiceLoader manually
if they're using R8.

R8 is then able to optimize away the ServiceLoader and reflection
entirely, resulting in direct class instantiation and no extra I/O
on calling thread.

Fixes #1231
* Properly use structured concurrency in the example code.
* Also remove a special not on <= 2 core CPU, which is no longer needed
because default dispatcher has always at least two CPUs.

Fixed #1241
* Introduce buffer operator
* Remove buffer size from all the other operators
* Fuse all adjacent operators that create channels
* Introduce Channel.BUFFERED buffer size marker to request
  buffered channel with a default (unspecified) size

Fixes #1233
* Introducing flowScope, builder necessary for creating cancellation-transparent flow operators
* Incorporate flow scope into flow operators

Fixes #1218
Fixes #1128
* Scan and emitAll operators
* Flow.first operators family (without firstOrNull and firstOrDefault support)
* More migrations

Fixes #1094
Fixes #1078
Fixes #1244
In addition, the `SegmentQueue` data structure, which emulates an infinite array with fast removing from the middle, is introduced for storing suspended acquirers in semaphore/mutex/channel algorithms.

Fixes #1088
…d provide AbstractFlow instead that enforces context preservation guarantees
@adibfara adibfara merged commit c1176f2 into adibfara:master Jun 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.