Home
last modified time | relevance | path

Searched refs:BufferOverflow (Results 1 – 25 of 35) sorted by relevance

12

/external/kotlinx.coroutines/kotlinx-coroutines-core/common/test/flow/operators/
DBufferConflationTest.kt17 onBufferOverflow: BufferOverflow = BufferOverflow.DROP_OLDEST, in <lambda>()
23BufferOverflow.DROP_OLDEST -> listOf(0) + (n - capacity until n).toList() // first item & capacity… in <lambda>()
24 BufferOverflow.DROP_LATEST -> (0..capacity).toList() // first & capacity following ones in <lambda>()
56 buffer(onBufferOverflow = BufferOverflow.DROP_OLDEST) in <lambda>()
62 buffer(0, onBufferOverflow = BufferOverflow.DROP_OLDEST) in <lambda>()
68 buffer(1, onBufferOverflow = BufferOverflow.DROP_OLDEST) in <lambda>()
74 buffer(10, onBufferOverflow = BufferOverflow.DROP_OLDEST) in <lambda>()
97 checkConflate(1, BufferOverflow.DROP_LATEST) { in <lambda>()
98 buffer(onBufferOverflow = BufferOverflow.DROP_LATEST) in <lambda>()
103 checkConflate(1, BufferOverflow.DROP_LATEST) { in <lambda>()
[all …]
DBufferTest.kt190 …ption> { flow.buffer(capacity = Channel.CONFLATED, onBufferOverflow = BufferOverflow.DROP_LATEST) } in <lambda>()
191 …ption> { flow.buffer(capacity = Channel.CONFLATED, onBufferOverflow = BufferOverflow.DROP_OLDEST) } in <lambda>()
/external/kotlinx.coroutines/kotlinx-coroutines-core/common/test/flow/sharing/
DShareInConflationTest.kt17 onBufferOverflow: BufferOverflow = BufferOverflow.DROP_OLDEST, in <lambda>()
34 … val first = if (onBufferOverflow == BufferOverflow.DROP_LATEST) 0 else n - bufferCapacity in <lambda>()
67 … buffer(onBufferOverflow = BufferOverflow.DROP_OLDEST).shareIn(it, SharingStarted.Eagerly, 1) in <lambda>()
73 … buffer(onBufferOverflow = BufferOverflow.DROP_OLDEST).shareIn(it, SharingStarted.Eagerly, 0) in <lambda>()
79 … buffer(onBufferOverflow = BufferOverflow.DROP_OLDEST).shareIn(it, SharingStarted.Eagerly, 10) in <lambda>()
85 … buffer(20, onBufferOverflow = BufferOverflow.DROP_OLDEST).shareIn(it, SharingStarted.Eagerly, 0) in <lambda>()
91 … buffer(7, onBufferOverflow = BufferOverflow.DROP_OLDEST).shareIn(it, SharingStarted.Eagerly, 11) in <lambda>()
103 …buffer(23).buffer(onBufferOverflow = BufferOverflow.DROP_OLDEST).shareIn(it, SharingStarted.Eagerl… in <lambda>()
108 checkConflation(1, BufferOverflow.DROP_LATEST) { in <lambda>()
109 … buffer(onBufferOverflow = BufferOverflow.DROP_LATEST).shareIn(it, SharingStarted.Eagerly, 0) in <lambda>()
[all …]
DStateInTest.kt22 assertSame(state, state.buffer(onBufferOverflow = BufferOverflow.DROP_OLDEST)) in <lambda>()
23 assertSame(state, state.buffer(0, onBufferOverflow = BufferOverflow.DROP_OLDEST)) in <lambda>()
24 assertSame(state, state.buffer(1, onBufferOverflow = BufferOverflow.DROP_OLDEST)) in <lambda>()
DSharedFlowTest.kt504 fun testDropLatest() = testDropLatestOrOldest(BufferOverflow.DROP_LATEST) in <lambda>()
507 fun testDropOldest() = testDropLatestOrOldest(BufferOverflow.DROP_OLDEST) in <lambda>()
509 private fun testDropLatestOrOldest(bufferOverflow: BufferOverflow) = runTest { in <lambda>()
520 BufferOverflow.DROP_OLDEST -> 5 in <lambda>()
521 BufferOverflow.DROP_LATEST -> 4 in <lambda>()
685 onBufferOverflow = BufferOverflow.DROP_OLDEST in <lambda>()
760 …egalArgumentException> { MutableSharedFlow<Int>(0, onBufferOverflow = BufferOverflow.DROP_LATEST) } in <lambda>()
761 …egalArgumentException> { MutableSharedFlow<Int>(0, onBufferOverflow = BufferOverflow.DROP_OLDEST) } in <lambda>()
/external/kotlinx.coroutines/reactive/kotlinx-coroutines-reactive/test/
DPublisherAsFlowTest.kt186 testRequestSizeWithBuffer(Channel.RENDEZVOUS, BufferOverflow.SUSPEND, 1) in <lambda>()
190 testRequestSizeWithBuffer(1, BufferOverflow.SUSPEND, 1) in <lambda>()
194 testRequestSizeWithBuffer(10, BufferOverflow.SUSPEND, 10) in <lambda>()
198 testRequestSizeWithBuffer(Channel.UNLIMITED, BufferOverflow.SUSPEND, Long.MAX_VALUE) in <lambda>()
202 testRequestSizeWithBuffer(Channel.BUFFERED, BufferOverflow.SUSPEND, 64) in <lambda>()
206 testRequestSizeWithBuffer(Channel.BUFFERED, BufferOverflow.DROP_OLDEST, Long.MAX_VALUE) in <lambda>()
210 testRequestSizeWithBuffer(Channel.BUFFERED, BufferOverflow.DROP_LATEST, Long.MAX_VALUE) in <lambda>()
214 testRequestSizeWithBuffer(10, BufferOverflow.DROP_OLDEST, Long.MAX_VALUE) in <lambda>()
218 testRequestSizeWithBuffer(10, BufferOverflow.DROP_LATEST, Long.MAX_VALUE) in <lambda>()
226 onBufferOverflow: BufferOverflow, in <lambda>()
[all …]
/external/kotlinx.coroutines/kotlinx-coroutines-core/common/src/flow/internal/
DMerge.kt14 onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND in <lambda>()
16 …override fun create(context: CoroutineContext, capacity: Int, onBufferOverflow: BufferOverflow): C… in <lambda>()
42 onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND
44 …override fun create(context: CoroutineContext, capacity: Int, onBufferOverflow: BufferOverflow): C… in create()
80 onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND in additionalToStringProps()
82 …override fun create(context: CoroutineContext, capacity: Int, onBufferOverflow: BufferOverflow): C… in additionalToStringProps()
DChannelFlow.kt29 onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND in <lambda>()
48 @JvmField public val onBufferOverflow: BufferOverflow
69 …ide fun fuse(context: CoroutineContext, capacity: Int, onBufferOverflow: BufferOverflow): Flow<T> { in dropChannelOperators()
74 val newOverflow: BufferOverflow in dropChannelOperators()
75 if (onBufferOverflow != BufferOverflow.SUSPEND) { in dropChannelOperators()
102 …n create(context: CoroutineContext, capacity: Int, onBufferOverflow: BufferOverflow): ChannelFlow<… in create()
130 … if (onBufferOverflow != BufferOverflow.SUSPEND) props.add("onBufferOverflow=$onBufferOverflow") in additionalToStringProps()
140 onBufferOverflow: BufferOverflow
183 onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND in toString()
185 …override fun create(context: CoroutineContext, capacity: Int, onBufferOverflow: BufferOverflow): C… in toString()
/external/kotlinx.coroutines/kotlinx-coroutines-core/common/test/channels/
DChannelFactoryTest.kt18 assertIs<BufferedChannel<*>>(Channel<Int>(Channel.UNLIMITED, BufferOverflow.DROP_OLDEST)) in testUnlimitedChannel()
19 assertIs<BufferedChannel<*>>(Channel<Int>(Channel.UNLIMITED, BufferOverflow.DROP_LATEST)) in testUnlimitedChannel()
25 assertIs<ConflatedBufferedChannel<*>>(Channel<Int>(1, BufferOverflow.DROP_OLDEST)) in testConflatedChannel()
31 assertIs<ConflatedBufferedChannel<*>>(Channel<Int>(1, BufferOverflow.DROP_LATEST)) in testBufferedChannel()
42 …assertFailsWith<IllegalArgumentException> { Channel<Int>(Channel.CONFLATED, BufferOverflow.DROP_OL… in testUnsupportedBufferOverflow()
43 …assertFailsWith<IllegalArgumentException> { Channel<Int>(Channel.CONFLATED, BufferOverflow.DROP_LA… in testUnsupportedBufferOverflow()
DChannelUndeliveredElementTest.kt141 testBufferOverflowStrategy(listOf(1, 2), BufferOverflow.DROP_OLDEST) in <lambda>()
142 testBufferOverflowStrategy(listOf(3), BufferOverflow.DROP_LATEST) in <lambda>()
145 …pend fun testBufferOverflowStrategy(expectedDroppedElements: List<Int>, strategy: BufferOverflow) { in <lambda>()
190 val channel = Channel<Int>(capacity, BufferOverflow.DROP_LATEST, onUndeliveredElement = { in <lambda>()
DChannelBufferOverflowTest.kt10 val c = Channel<Int>(2, BufferOverflow.DROP_LATEST) in <lambda>()
25 val c = Channel<Int>(2, BufferOverflow.DROP_OLDEST) in <lambda>()
/external/kotlinx.coroutines/kotlinx-coroutines-core/common/src/flow/
DBuilders.kt310 onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND in channelFlow()
312 …override fun create(context: CoroutineContext, capacity: Int, onBufferOverflow: BufferOverflow): C… in channelFlow()
326 onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND
347 …override fun create(context: CoroutineContext, capacity: Int, onBufferOverflow: BufferOverflow): C…
DSharedFlow.kt280 onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND in emit()
284 require(replay > 0 || extraBufferCapacity > 0 || onBufferOverflow == BufferOverflow.SUSPEND) { in emit()
320 private val onBufferOverflow: BufferOverflow
431 BufferOverflow.SUSPEND -> return false // will suspend in tryEmitLocked()
432 BufferOverflow.DROP_LATEST -> return true // just drop incoming in tryEmitLocked()
433 BufferOverflow.DROP_OLDEST -> {} // force enqueue & drop oldest instead in tryEmitLocked()
714 override fun fuse(context: CoroutineContext, capacity: Int, onBufferOverflow: BufferOverflow) = in fuse()
736 onBufferOverflow: BufferOverflow in Array()
740 …ENDEZVOUS || capacity == Channel.OPTIONAL_CHANNEL) && onBufferOverflow == BufferOverflow.SUSPEND) { in Array()
DChannels.kt95 onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND in receiveAsFlow()
105 …override fun create(context: CoroutineContext, capacity: Int, onBufferOverflow: BufferOverflow): C… in receiveAsFlow()
DStateFlow.kt417 override fun fuse(context: CoroutineContext, capacity: Int, onBufferOverflow: BufferOverflow) = in createSlot()
424 onBufferOverflow: BufferOverflow in createSlot()
428 …if ((capacity in 0..1 || capacity == Channel.BUFFERED) && onBufferOverflow == BufferOverflow.DROP_… in createSlot()
/external/rust/android-crates-io/crates/ucs2/src/
Dlib.rs21 BufferOverflow, enumerator
29 Self::BufferOverflow => f.write_str("output buffer is too small"), in fmt()
109 Err(Error::BufferOverflow) in encode()
194 return Err(Error::BufferOverflow); in decode()
203 return Err(Error::BufferOverflow); in decode()
213 return Err(Error::BufferOverflow); in decode()
/external/rust/android-crates-io/crates/ucs2/tests/
Dtests.rs12 assert_eq!(encode(input, &mut buffer), Err(Error::BufferOverflow)); in encoding()
32 Err(Error::BufferOverflow) in decoding()
36 Err(Error::BufferOverflow) in decoding()
40 Err(Error::BufferOverflow) in decoding()
/external/kotlinx.coroutines/kotlinx-coroutines-core/common/src/flow/operators/
DContext.kt121 …> Flow<T>.buffer(capacity: Int = BUFFERED, onBufferOverflow: BufferOverflow = BufferOverflow.SUSPE… in buffer()
125 require(capacity != CONFLATED || onBufferOverflow == BufferOverflow.SUSPEND) { in buffer()
133 onBufferOverflow = BufferOverflow.DROP_OLDEST in buffer()
DShare.kt150 @JvmField val onBufferOverflow: BufferOverflow,
168 … onBufferOverflow == BufferOverflow.SUSPEND -> // buffer was configured with suspension in configureSharing()
184 onBufferOverflow = BufferOverflow.SUSPEND, in configureSharing()
372 override fun fuse(context: CoroutineContext, capacity: Int, onBufferOverflow: BufferOverflow) = in asSharedFlow()
382 override fun fuse(context: CoroutineContext, capacity: Int, onBufferOverflow: BufferOverflow) = in fuse()
/external/kotlinx.coroutines/kotlinx-coroutines-core/common/src/channels/
DProduce.kt244 …produce(context, capacity, BufferOverflow.SUSPEND, CoroutineStart.DEFAULT, onCompletion = null, bl… in produce()
266 produce(context, capacity, BufferOverflow.SUSPEND, start, onCompletion, block) in produce()
272 onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND, in produce()
DChannel.kt1429 onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND, in Channel()
1434 if (onBufferOverflow == BufferOverflow.SUSPEND) in Channel()
1440 require(onBufferOverflow == BufferOverflow.SUSPEND) { in Channel()
1443 ConflatedBufferedChannel(1, BufferOverflow.DROP_OLDEST, onUndeliveredElement) in Channel()
1447 …if (onBufferOverflow == BufferOverflow.SUSPEND) BufferedChannel(CHANNEL_DEFAULT_CAPACITY, onUndeli… in Channel()
1451 … if (onBufferOverflow === BufferOverflow.SUSPEND) BufferedChannel(capacity, onUndeliveredElement) in Channel()
DConflatedBufferedChannel.kt3 import kotlinx.coroutines.channels.BufferOverflow.*
16 private val onBufferOverflow: BufferOverflow,
DBufferOverflow.kt14 public enum class BufferOverflow { class
/external/kotlinx.coroutines/reactive/kotlinx-coroutines-reactive/src/
DReactiveFlow.kt48 onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND in <lambda>()
50 …override fun create(context: CoroutineContext, capacity: Int, onBufferOverflow: BufferOverflow): C… in <lambda>()
61 if (onBufferOverflow != BufferOverflow.SUSPEND) { in <lambda>()
115 onBufferOverflow: BufferOverflow,
/external/lottie/lottie-compose/src/main/java/com/airbnb/lottie/compose/
DLottieRetrySignal.kt9 import kotlinx.coroutines.channels.BufferOverflow
33 private val channel = Channel<Unit>(capacity = 1, onBufferOverflow = BufferOverflow.DROP_OLDEST)

12