You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
all operators on ReceiveChannel fully consume the original channel
using a helper consume extension, which is reflected in docs;
removed `suspend` modifier from intermediate channel operators;
consistently renamed channel type param to <E>;
added two versions for xxxTo fun -- with MutableList & SendChannel;
added tests for all channel operators;
dropped/deprecated ActorJob/ProducerJob, fixes#127
| [launch] | [Job] | [CoroutineScope] | Launches coroutine that does not have any result
10
10
| [async] | [Deferred] | [CoroutineScope] | Returns a single value with the future result
11
-
| [produce][kotlinx.coroutines.experimental.channels.produce] | [ProducerJob][kotlinx.coroutines.experimental.channels.ProducerJob] | [ProducerScope][kotlinx.coroutines.experimental.channels.ProducerScope] | Produces a stream of elements
12
-
| [actor][kotlinx.coroutines.experimental.channels.actor] | [ActorJob][kotlinx.coroutines.experimental.channels.ActorJob] | [ActorScope][kotlinx.coroutines.experimental.channels.ActorScope] | Processes a stream of messages
11
+
| [produce][kotlinx.coroutines.experimental.channels.produce] | [ReceiveChannel][kotlinx.coroutines.experimental.channels.ReceiveChannel] | [ProducerScope][kotlinx.coroutines.experimental.channels.ProducerScope] | Produces a stream of elements
12
+
| [actor][kotlinx.coroutines.experimental.channels.actor] | [SendChannel][kotlinx.coroutines.experimental.channels.SendChannel] | [ActorScope][kotlinx.coroutines.experimental.channels.ActorScope] | Processes a stream of messages
13
13
| [runBlocking] | `T` | [CoroutineScope] | Blocks the thread while the coroutine runs
Copy file name to clipboardExpand all lines: core/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/channels/ArrayBroadcastChannel.kt
+4-4
Original file line number
Diff line number
Diff line change
@@ -209,10 +209,10 @@ class ArrayBroadcastChannel<E>(
209
209
overrideval isBufferAlwaysFull:Boolean get() = error("Should not be used")
210
210
overrideval isBufferFull:Boolean get() = error("Should not be used")
211
211
212
-
overridefunclose() {
213
-
if (close(cause=null))
214
-
broadcastChannel.updateHead(removeSub =this)
215
-
}
212
+
overridefuncancel(cause:Throwable?): Boolean=
213
+
close(cause).also { closed ->
214
+
if (closed) broadcastChannel.updateHead(removeSub =this)
215
+
}
216
216
217
217
// returns true if subHead was updated and broadcast channel's head must be checked
218
218
// this method is lock-free (it never waits on lock)
0 commit comments