mirror of
https://github.com/tursom/TursomServer.git
synced 2025-02-08 10:40:48 +08:00
添加协程mongo驱动
This commit is contained in:
parent
655aafdb27
commit
689490748e
@ -173,14 +173,14 @@ class AsyncMongoOperator<T : Any>(
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun hasNext(): Boolean = if (cache.isEmpty()) {
|
||||
suspendCoroutine<Unit> {
|
||||
notify.set(it)
|
||||
subscription.request(bufSize.toLong())
|
||||
override suspend fun hasNext(): Boolean {
|
||||
if (cache.isEmpty() && !compete) {
|
||||
suspendCoroutine<Unit> {
|
||||
notify.set(it)
|
||||
subscription.request(bufSize.toLong())
|
||||
}
|
||||
}
|
||||
!compete
|
||||
} else {
|
||||
!compete
|
||||
return cache.isNotEmpty()
|
||||
}
|
||||
}
|
||||
publisher.subscribe(subscriber)
|
||||
|
Loading…
Reference in New Issue
Block a user