#521 - Add example for Kotlin Coroutines and Flow support.

Original pull request: #522.
This commit is contained in:
Christoph Strobl
2019-08-12 12:22:18 +02:00
committed by Mark Paluch
parent 9080685591
commit 4f0b76ee5d
3 changed files with 111 additions and 0 deletions

View File

@@ -63,3 +63,16 @@ Using the `Criteria` extensions allows to write type-safe queries via an ideomat
operations.find<Person>(Query(Person::firstname isEqualTo "Tyrion"))
```
## Coroutines and Flow support
```kotlin
runBlocking {
operations.find<Person>(Query(where("firstname").isEqualTo("Tyrion"))).awaitSingle()
}
```
```kotlin
runBlocking {
operations.findAll<Person>().asFlow().toList()
}
```