Skip to content

Commit 168b145

Browse files
committed
Use awaitSingle operator instead of awaitFirst.
Operators `awaitFirstXxx` are going to be deprecated. Also, awaitFirst operator has no value on Mono types. Related #25007 Signed-off-by: George Papadopoulos <[email protected]>
1 parent 58bf556 commit 168b145

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spring-data-r2dbc/src/main/kotlin/org/springframework/data/r2dbc/core/ReactiveSelectOperationExtensions.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ package org.springframework.data.r2dbc.core
1717

1818
import kotlinx.coroutines.flow.Flow
1919
import kotlinx.coroutines.reactive.asFlow
20-
import kotlinx.coroutines.reactive.awaitFirstOrNull
2120
import kotlinx.coroutines.reactive.awaitSingle
21+
import kotlinx.coroutines.reactor.awaitSingleOrNull
2222

2323
/**
2424
* Extensions for [ReactiveSelectOperation].
2525
*
26-
* @author Mark Paluch
26+
* @author Mark Paluch, George Papadopoulos
2727
* @since 1.1
2828
*/
2929

@@ -49,7 +49,7 @@ suspend inline fun <reified T : Any> ReactiveSelectOperation.TerminatingSelect<T
4949
* Nullable Coroutines variant of [ReactiveSelectOperation.TerminatingSelect.one].
5050
*/
5151
suspend inline fun <reified T : Any> ReactiveSelectOperation.TerminatingSelect<T>.awaitOneOrNull(): T? =
52-
one().awaitFirstOrNull()
52+
one().awaitSingleOrNull()
5353

5454
/**
5555
* Non-nullable Coroutines variant of [ReactiveSelectOperation.TerminatingSelect.first].
@@ -61,7 +61,7 @@ suspend inline fun <reified T : Any> ReactiveSelectOperation.TerminatingSelect<T
6161
* Nullable Coroutines variant of [ReactiveSelectOperation.TerminatingSelect.first].
6262
*/
6363
suspend inline fun <reified T : Any> ReactiveSelectOperation.TerminatingSelect<T>.awaitFirstOrNull(): T? =
64-
first().awaitFirstOrNull()
64+
first().awaitSingleOrNull()
6565

6666
/**
6767
* Coroutines variant of [ReactiveSelectOperation.TerminatingSelect.count].

0 commit comments

Comments
 (0)