Roman Elizarov | 4391897 | 2017-10-07 21:00:06 +0300 | [diff] [blame] | 1 | /* |
Roman Elizarov | 1f74a2d | 2018-06-29 19:19:45 +0300 | [diff] [blame^] | 2 | * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. |
Roman Elizarov | 4391897 | 2017-10-07 21:00:06 +0300 | [diff] [blame] | 3 | */ |
| 4 | |
| 5 | package kotlinx.coroutines.experimental.channels |
| 6 | |
| 7 | enum class TestBroadcastChannelKind { |
| 8 | ARRAY_1 { |
Vsevolod Tolstopyatov | 9619134 | 2018-04-20 18:13:33 +0300 | [diff] [blame] | 9 | override fun <T> create(): BroadcastChannel<T> = ArrayBroadcastChannel(1) |
Roman Elizarov | 4391897 | 2017-10-07 21:00:06 +0300 | [diff] [blame] | 10 | override fun toString(): String = "ArrayBroadcastChannel(1)" |
| 11 | }, |
| 12 | ARRAY_10 { |
Vsevolod Tolstopyatov | 9619134 | 2018-04-20 18:13:33 +0300 | [diff] [blame] | 13 | override fun <T> create(): BroadcastChannel<T> = ArrayBroadcastChannel(10) |
Roman Elizarov | 4391897 | 2017-10-07 21:00:06 +0300 | [diff] [blame] | 14 | override fun toString(): String = "ArrayBroadcastChannel(10)" |
| 15 | }, |
| 16 | CONFLATED { |
Vsevolod Tolstopyatov | 9619134 | 2018-04-20 18:13:33 +0300 | [diff] [blame] | 17 | override fun <T> create(): BroadcastChannel<T> = ConflatedBroadcastChannel() |
Roman Elizarov | 4391897 | 2017-10-07 21:00:06 +0300 | [diff] [blame] | 18 | override fun toString(): String = "ConflatedBroadcastChannel" |
| 19 | override val isConflated: Boolean get() = true |
| 20 | } |
| 21 | ; |
| 22 | |
Roman Elizarov | 45c8565 | 2017-10-13 14:46:22 +0300 | [diff] [blame] | 23 | abstract fun <T> create(): BroadcastChannel<T> |
Roman Elizarov | 4391897 | 2017-10-07 21:00:06 +0300 | [diff] [blame] | 24 | open val isConflated: Boolean get() = false |
| 25 | } |