mirror of
https://github.com/tursom/TursomServer.git
synced 2025-02-12 21:00:35 +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()) {
|
override suspend fun hasNext(): Boolean {
|
||||||
suspendCoroutine<Unit> {
|
if (cache.isEmpty() && !compete) {
|
||||||
notify.set(it)
|
suspendCoroutine<Unit> {
|
||||||
subscription.request(bufSize.toLong())
|
notify.set(it)
|
||||||
|
subscription.request(bufSize.toLong())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
!compete
|
return cache.isNotEmpty()
|
||||||
} else {
|
|
||||||
!compete
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
publisher.subscribe(subscriber)
|
publisher.subscribe(subscriber)
|
||||||
|
Loading…
Reference in New Issue
Block a user