7
7
package kotlinx.coroutines.channels
8
8
9
9
import kotlinx.coroutines.*
10
+ import kotlinx.coroutines.channels.Channel.Factory.BUFFERED
11
+ import kotlinx.coroutines.channels.Channel.Factory.CHANNEL_DEFAULT_CAPACITY
10
12
import kotlinx.coroutines.channels.Channel.Factory.CONFLATED
11
13
import kotlinx.coroutines.channels.Channel.Factory.RENDEZVOUS
12
14
import kotlinx.coroutines.channels.Channel.Factory.UNLIMITED
13
- import kotlinx.coroutines.channels.Channel.Factory.BUFFERED
14
- import kotlinx.coroutines.channels.Channel.Factory.CHANNEL_DEFAULT_CAPACITY
15
- import kotlinx.coroutines.internal.systemProp
15
+ import kotlinx.coroutines.internal.*
16
16
import kotlinx.coroutines.selects.*
17
- import kotlin.jvm.*
18
17
import kotlin.internal.*
18
+ import kotlin.jvm.*
19
19
20
20
/* *
21
21
* Sender's interface to [Channel].
@@ -314,7 +314,7 @@ public interface ReceiveChannel<out E> {
314
314
* @suppress This method implements old version of JVM ABI. Use [cancel].
315
315
*/
316
316
@Deprecated(level = DeprecationLevel .HIDDEN , message = " Since 1.2.0, binary compatibility with versions <= 1.1.x" )
317
- public fun cancel () = cancel(null )
317
+ public fun cancel (): Unit = cancel(null )
318
318
319
319
/* *
320
320
* @suppress This method has bad semantics when cause is not a [CancellationException]. Use [cancel].
@@ -517,25 +517,25 @@ public interface Channel<E> : SendChannel<E>, ReceiveChannel<E> {
517
517
/* *
518
518
* Requests a channel with an unlimited capacity buffer in the `Channel(...)` factory function
519
519
*/
520
- public const val UNLIMITED = Int .MAX_VALUE
520
+ public const val UNLIMITED : Int = Int .MAX_VALUE
521
521
522
522
/* *
523
523
* Requests a rendezvous channel in the `Channel(...)` factory function — a `RendezvousChannel` gets created.
524
524
*/
525
- public const val RENDEZVOUS = 0
525
+ public const val RENDEZVOUS : Int = 0
526
526
527
527
/* *
528
528
* Requests a conflated channel in the `Channel(...)` factory function — a `ConflatedChannel` gets created.
529
529
*/
530
- public const val CONFLATED = - 1
530
+ public const val CONFLATED : Int = - 1
531
531
532
532
/* *
533
533
* Requests a buffered channel with the default buffer capacity in the `Channel(...)` factory function —
534
534
* an `ArrayChannel` gets created with the default capacity.
535
535
* The default capacity is 64 and can be overridden by setting
536
536
* [DEFAULT_BUFFER_PROPERTY_NAME] on JVM.
537
537
*/
538
- public const val BUFFERED = - 2
538
+ public const val BUFFERED : Int = - 2
539
539
540
540
// only for internal use, cannot be used with Channel(...)
541
541
internal const val OPTIONAL_CHANNEL = - 3
@@ -544,7 +544,7 @@ public interface Channel<E> : SendChannel<E>, ReceiveChannel<E> {
544
544
* Name of the property that defines the default channel capacity when
545
545
* [BUFFERED] is used as parameter in `Channel(...)` factory function.
546
546
*/
547
- public const val DEFAULT_BUFFER_PROPERTY_NAME = " kotlinx.coroutines.channels.defaultBuffer"
547
+ public const val DEFAULT_BUFFER_PROPERTY_NAME : String = " kotlinx.coroutines.channels.defaultBuffer"
548
548
549
549
internal val CHANNEL_DEFAULT_CAPACITY = systemProp(DEFAULT_BUFFER_PROPERTY_NAME ,
550
550
64 , 1 , UNLIMITED - 1
0 commit comments