diff --git a/README.md b/README.md index ec1b0ba..1852a64 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ runtime of applications. | [ How to use: Including in project ](#including-in-project) | | [ How to use: Config from string ](#config-from-string) | | [ How to use: Config via builder (DSL preview) ](#config-via-builder) | +| [ How to use: KronScheduler as a Flow ](#KronScheduler-as-a-Flow) | ## How to use @@ -124,3 +125,28 @@ kronScheduler.doInfinity { ``` All of these examples will do the same things: print `Called` message every five seconds. + +### KronScheduler as a Flow + +Any `KronScheduler`can e converted to a `Flow + it.async { + var collected = 0 + flow.takeWhile { + collected < mustBeCollected + }.collect { + collected++ + } + collected + } + }.awaitAll() + + failJob.cancel() + + answers.forEach { + assertEquals(mustBeCollected, it) + } + } + } }