Skip to content

Commit 89f4c7e

Browse files
Quantum64mp911de
authored andcommitted
Add approximate trimming to reactive stream extensions.
See #2227
1 parent 9a782ac commit 89f4c7e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/kotlin/org/springframework/data/redis/core/ReactiveStreamOperationsExtensions.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ inline fun <K : Any, reified V : Any> ReactiveStreamOperations<K, *, *>.reverseR
263263
* Coroutines variant of [ReactiveStreamOperations.trim].
264264
*
265265
* @author Mark Paluch
266+
* @author Quantum64@github
266267
* @since 2.2
267268
*/
268-
suspend fun <K : Any, HK : Any, HV : Any> ReactiveStreamOperations<K, HK, HV>.trimAndAwait(key: K, count: Long): Long =
269-
trim(key, count).awaitSingle()
269+
@JvmOverloads // Maintain compatibility with versions <= 2.6.0
270+
suspend fun <K : Any, HK : Any, HV : Any> ReactiveStreamOperations<K, HK, HV>.trimAndAwait(key: K, count: Long, approximateTrimming: Boolean = false): Long =
271+
trim(key, count, approximateTrimming).awaitSingle()

0 commit comments

Comments
 (0)