Add approximate trimming to reactive stream extensions.

See #2227
This commit is contained in:
Dylan
2022-01-07 02:04:29 -05:00
committed by Mark Paluch
parent 9a782ac85d
commit 89f4c7e238

View File

@@ -263,7 +263,9 @@ inline fun <K : Any, reified V : Any> ReactiveStreamOperations<K, *, *>.reverseR
* Coroutines variant of [ReactiveStreamOperations.trim].
*
* @author Mark Paluch
* @author Quantum64@github
* @since 2.2
*/
suspend fun <K : Any, HK : Any, HV : Any> ReactiveStreamOperations<K, HK, HV>.trimAndAwait(key: K, count: Long): Long =
trim(key, count).awaitSingle()
@JvmOverloads // Maintain compatibility with versions <= 2.6.0
suspend fun <K : Any, HK : Any, HV : Any> ReactiveStreamOperations<K, HK, HV>.trimAndAwait(key: K, count: Long, approximateTrimming: Boolean = false): Long =
trim(key, count, approximateTrimming).awaitSingle()