Home
last modified time | relevance | path

Searched refs:SharingStarted (Results 1 – 15 of 15) sorted by relevance

/external/kotlinx.coroutines/kotlinx-coroutines-core/common/test/flow/sharing/
DSharingStartedWhileSubscribedTest.kt18 val map = HashMap<SharingStarted, Pair<Long, Long>>() in testEqualsAndHashcode()
21 map[SharingStarted.WhileSubscribed(i, j)] = i to j in testEqualsAndHashcode()
26 assertEquals(i to j, map[SharingStarted.WhileSubscribed(i, j)]) in testEqualsAndHashcode()
33 … assertEquals(SharingStarted.WhileSubscribed(0), SharingStarted.WhileSubscribed(Duration.ZERO)) in testDurationParams()
34 … assertEquals(SharingStarted.WhileSubscribed(10), SharingStarted.WhileSubscribed(10.milliseconds)) in testDurationParams()
35 … assertEquals(SharingStarted.WhileSubscribed(1000), SharingStarted.WhileSubscribed(1.seconds)) in testDurationParams()
36 …assertEquals(SharingStarted.WhileSubscribed(Long.MAX_VALUE), SharingStarted.WhileSubscribed(Durati… in testDurationParams()
37 …assertEquals(SharingStarted.WhileSubscribed(replayExpirationMillis = 0), SharingStarted.WhileSubsc… in testDurationParams()
38 …assertEquals(SharingStarted.WhileSubscribed(replayExpirationMillis = 3), SharingStarted.WhileSubsc… in testDurationParams()
41 assertEquals(SharingStarted.WhileSubscribed(replayExpirationMillis = 7000), in testDurationParams()
[all …]
DShareInConflationTest.kt52 conflate().shareIn(it, SharingStarted.Eagerly, 1) in <lambda>()
58 conflate().shareIn(it, SharingStarted.Eagerly, 0) in <lambda>()
64 conflate().shareIn(it, SharingStarted.Eagerly, 5) in <lambda>()
70 … buffer(onBufferOverflow = BufferOverflow.DROP_OLDEST).shareIn(it, SharingStarted.Eagerly, 1) in <lambda>()
76 … buffer(onBufferOverflow = BufferOverflow.DROP_OLDEST).shareIn(it, SharingStarted.Eagerly, 0) in <lambda>()
82 … buffer(onBufferOverflow = BufferOverflow.DROP_OLDEST).shareIn(it, SharingStarted.Eagerly, 10) in <lambda>()
88 … buffer(20, onBufferOverflow = BufferOverflow.DROP_OLDEST).shareIn(it, SharingStarted.Eagerly, 0) in <lambda>()
94 … buffer(7, onBufferOverflow = BufferOverflow.DROP_OLDEST).shareIn(it, SharingStarted.Eagerly, 11) in <lambda>()
100 buffer(23).conflate().shareIn(it, SharingStarted.Eagerly, 1) in <lambda>()
106 …er(23).buffer(onBufferOverflow = BufferOverflow.DROP_OLDEST).shareIn(it, SharingStarted.Eagerly, 1) in <lambda>()
[all …]
DShareInBufferTest.kt54 shareIn(it, SharingStarted.Eagerly) in <lambda>()
60 shareIn(it, SharingStarted.Eagerly, 1) in <lambda>()
66 shareIn(it, SharingStarted.Eagerly, 10) in <lambda>()
72 shareIn(it, SharingStarted.Eagerly, 100) in <lambda>()
78 buffer().shareIn(it, SharingStarted.Eagerly) in <lambda>()
84 buffer(0).shareIn(it, SharingStarted.Eagerly) in <lambda>()
90 buffer(10).shareIn(it, SharingStarted.Eagerly) in <lambda>()
96 buffer(10).buffer(20).shareIn(it, SharingStarted.Eagerly, 11) in <lambda>()
DShareInTest.kt16 val shared = flow.shareIn(this, SharingStarted.Eagerly) in <lambda>()
43 … val shared = flow.shareIn(this + sharingJob, started = SharingStarted.Lazily, replay = replay) in <lambda>()
98 val shared = upstream.shareIn(this + sharingJob, SharingStarted.Eagerly, 1) in <lambda>()
115 testWhileSubscribed(1, SharingStarted.WhileSubscribed()) in <lambda>()
119 testWhileSubscribed(1, SharingStarted.WhileSubscribedAtLeast(1)) in <lambda>()
123 testWhileSubscribed(2, SharingStarted.WhileSubscribedAtLeast(2)) in <lambda>()
126 private fun testWhileSubscribed(threshold: Int, started: SharingStarted) = runTest { in <lambda>()
190 private fun SharingStarted.Companion.WhileSubscribedAtLeast(threshold: Int) = in <lambda>() method
191 SharingStarted { subscriptionCount -> in <lambda>()
220 }.shareIn(this, SharingStarted.Lazily) in <lambda>()
[all …]
DSharingStartedTest.kt18 testSharingStarted(SharingStarted.Eagerly, SharingCommand.START) { in testEagerly()
27 testSharingStarted(SharingStarted.Lazily) { in testLazily()
35 testSharingStarted(SharingStarted.WhileSubscribed()) { in testWhileSubscribed()
44 testSharingStarted(SharingStarted.WhileSubscribed(replayExpirationMillis = 0)) { in testWhileSubscribedExpireImmediately()
53 testSharingStarted(SharingStarted.WhileSubscribed(stopTimeoutMillis = 100)) { in testWhileSubscribedWithTimeout()
67 testSharingStarted(SharingStarted.WhileSubscribed(replayExpirationMillis = 200)) { in testWhileSubscribedExpiration()
80 …testSharingStarted(SharingStarted.WhileSubscribed(stopTimeoutMillis = 400, replayExpirationMillis … in testWhileSubscribedStopAndExpiration()
111 started: SharingStarted, in testSharingStarted()
128 val started: SharingStarted,
DShareInFusionTest.kt17 val sh = emptyFlow<Int>().shareIn(this, SharingStarted.Eagerly) in <lambda>()
31 assertEquals("OK", flow.shareIn(this, SharingStarted.Eagerly, 1).first()) in <lambda>()
50 val shared = flow.shareIn(this, SharingStarted.Eagerly) in <lambda>()
DStateInTest.kt60 shared = upstream.stateIn(scope, SharingStarted.Eagerly, null) in <lambda>()
/external/kotlinx.coroutines/kotlinx-coroutines-core/common/src/flow/
DSharingStarted.kt75 public fun interface SharingStarted { interface
80 public val Eagerly: SharingStarted = StartedEagerly()
85 public val Lazily: SharingStarted = StartedLazily()
108 ): SharingStarted = in WhileSubscribed()
138 public fun SharingStarted.Companion.WhileSubscribed( in WhileSubscribed()
141 ): SharingStarted = in WhileSubscribed()
146 private class StartedEagerly : SharingStarted { in WhileSubscribed()
152 private class StartedLazily : SharingStarted {
169 ) : SharingStarted { in toString()
/external/kotlinx.coroutines/kotlinx-coroutines-core/jvm/test/flow/
DSharingStressTest.kt31 testStress(0, started = SharingStarted.Lazily) in <lambda>()
35 testStress(0, started = SharingStarted.WhileSubscribed()) in <lambda>()
39 testStress(0, started = SharingStarted.WhileSubscribed(stopTimeoutMillis = 50L)) in <lambda>()
43 testStress(100, started = SharingStarted.WhileSubscribed()) in <lambda>()
47 testStress(100, started = SharingStarted.WhileSubscribed(replayExpirationMillis = 0L)) in <lambda>()
51 testStress(100, started = SharingStarted.WhileSubscribed(stopTimeoutMillis = 50L)) in <lambda>()
55 testStress(1, started = SharingStarted.Lazily) in <lambda>()
59 testStress(1, started = SharingStarted.WhileSubscribed()) in <lambda>()
63 testStress(1, started = SharingStarted.WhileSubscribed(replayExpirationMillis = 0L)) in <lambda>()
65 private fun testStress(replay: Int, started: SharingStarted) = runTest { in <lambda>()
DSharingReferenceTest.kt39 val flow = weakEmitter.shareIn(ContextScope(executor), SharingStarted.Eagerly, 0) in testShareInReference()
46 val flow = weakEmitter.stateIn(ContextScope(executor), SharingStarted.Eagerly, null) in testStateInReference()
/external/kotlinx.coroutines/kotlinx-coroutines-core/common/src/flow/operators/
DShare.kt137 started: SharingStarted, in <lambda>()
198 started: SharingStarted, in launchSharing()
208 …val start = if (started == SharingStarted.Eagerly) CoroutineStart.DEFAULT else CoroutineStart.UNDI… in launchSharing()
212 started === SharingStarted.Eagerly -> { in launchSharing()
216 started === SharingStarted.Lazily -> { in launchSharing()
309 started: SharingStarted, in stateIn()
/external/kotlinx.coroutines/kotlinx-coroutines-test/jvm/test/migration/
DRunBlockingTestOnTestScopeTest.kt317 val stateFlow = myFlow.stateIn(backgroundScope, SharingStarted.Eagerly, 0) in <lambda>()
/external/kotlinx.coroutines/kotlinx-coroutines-core/api/
Dkotlinx-coroutines-core.api1113 …low/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/SharingStarted;I)Lkotlinx/cor…
1114 …low/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/SharingStarted;IILjava/lang/O…
1121 …low/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/SharingStarted;Ljava/lang/Obj…
1185 public abstract interface class kotlinx/coroutines/flow/SharingStarted {
1186 public static final field Companion Lkotlinx/coroutines/flow/SharingStarted$Companion;
1190 public final class kotlinx/coroutines/flow/SharingStarted$Companion {
1191 public final fun WhileSubscribed (JJ)Lkotlinx/coroutines/flow/SharingStarted;
1192 …efault (Lkotlinx/coroutines/flow/SharingStarted$Companion;JJILjava/lang/Object;)Lkotlinx/coroutine…
1193 public final fun getEagerly ()Lkotlinx/coroutines/flow/SharingStarted;
1194 public final fun getLazily ()Lkotlinx/coroutines/flow/SharingStarted;
[all …]
/external/kotlinx.coroutines/kotlinx-coroutines-test/common/test/
DTestScopeTest.kt344 val stateFlow = myFlow.stateIn(backgroundScope, SharingStarted.Eagerly, 0) in <lambda>()
/external/kotlinx.coroutines/
DCHANGES_UP_TO_1.7.md446 * `SharingStarted` is now `fun` interface (#2397).