Skip to content

Commit 70410db

Browse files
author
İbrahim Yilmaz
committed
ticker renamed to tickerFlow to be more specific.
1 parent 2d231f6 commit 70410db

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

kotlinx-coroutines-core/jvm/src/flow/TickerFlows.kt renamed to kotlinx-coroutines-core/jvm/src/flow/TickerFlow.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import kotlin.concurrent.schedule
1616
* @param period period between each element in milliseconds.
1717
* @param initialDelay delay after which the first element will be produced (it is equal to [period] by default) in milliseconds.
1818
*/
19-
public fun ticker(
19+
public fun tickerFlow(
2020
period: Long,
2121
initialDelay: Long = period
2222
): Flow<Unit> = callbackFlow {

kotlinx-coroutines-core/jvm/test/flow/TickerFlowsTest.kt renamed to kotlinx-coroutines-core/jvm/test/flow/TickerFlowTest.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,30 @@ import kotlinx.coroutines.cancelAndJoin
55
import kotlinx.coroutines.delay
66
import kotlinx.coroutines.flow.launchIn
77
import kotlinx.coroutines.flow.onEach
8-
import kotlinx.coroutines.flow.ticker
8+
import kotlinx.coroutines.flow.tickerFlow
99
import java.util.concurrent.CancellationException
1010
import kotlin.test.Test
1111
import kotlin.test.assertEquals
1212

1313

14-
class TickerFlowsTest : TestBase() {
14+
class TickerFlowTest : TestBase() {
1515

1616
@Test(expected = IllegalArgumentException::class)
1717
fun testNegativePeriod() = runTest {
1818
// WHEN
19-
ticker(-1).launchIn(this)
19+
tickerFlow(-1).launchIn(this)
2020
}
2121

2222
@Test(expected = IllegalArgumentException::class)
2323
fun testZeroNegativePeriod() = runTest {
2424
// WHEN
25-
ticker(0).launchIn(this)
25+
tickerFlow(0).launchIn(this)
2626
}
2727

2828
@Test(expected = IllegalArgumentException::class)
2929
fun testNegativeInitialDelay() = runTest {
3030
// WHEN
31-
ticker(100, -1).launchIn(this)
31+
tickerFlow(100, -1).launchIn(this)
3232
}
3333

3434
@Test
@@ -38,7 +38,7 @@ class TickerFlowsTest : TestBase() {
3838

3939
// WHEN
4040
val periodicTicker =
41-
ticker(100, 100).onEach {
41+
tickerFlow(100, 100).onEach {
4242
inbox.add(Unit)
4343
}.launchIn(this)
4444

@@ -58,7 +58,7 @@ class TickerFlowsTest : TestBase() {
5858

5959
// WHEN
6060
val periodicTicker =
61-
ticker(100).onEach {
61+
tickerFlow(100).onEach {
6262
inbox.add(Unit)
6363
}.launchIn(this)
6464

@@ -77,7 +77,7 @@ class TickerFlowsTest : TestBase() {
7777

7878
// WHEN
7979
val periodicTicker =
80-
ticker(100).onEach {
80+
tickerFlow(100).onEach {
8181
inbox.add(Unit)
8282
}.launchIn(this)
8383

0 commit comments

Comments
 (0)