mirror of
https://github.com/InsanusMokrassar/docs.git
synced 2024-11-25 11:38:59 +00:00
update krontab docs
This commit is contained in:
parent
55e8840a27
commit
c0e7ac5f27
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
[![KDocs](https://img.shields.io/badge/KDocs-323330?style=for-the-badge&logo=Kotlin&logoColor=7F52FF)](https://insanusmokrassar.github.io/krontab/)
|
[![KDocs](https://img.shields.io/badge/KDocs-323330?style=for-the-badge&logo=Kotlin&logoColor=7F52FF)](https://insanusmokrassar.github.io/krontab/)
|
||||||
|
|
||||||
Library was created to give oppotunity to launch some things from time to time according to some schedule in
|
Library was created to give opportunity to launch some things from time to time according to some schedule in
|
||||||
runtime of applications.
|
runtime of applications.
|
||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
@ -77,7 +77,7 @@ doWhile("/5 * * * *") {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
An other version:
|
Another version:
|
||||||
|
|
||||||
```kotlin
|
```kotlin
|
||||||
doInfinity("/5 * * * *") {
|
doInfinity("/5 * * * *") {
|
||||||
@ -166,7 +166,7 @@ coroutine is alive` and in fact executing will be stopped when coroutine became
|
|||||||
|
|
||||||
### KronScheduler as a Flow
|
### KronScheduler as a Flow
|
||||||
|
|
||||||
Any `KronScheduler`can e converted to a `Flow<DateTime` using extension `asFlow`:
|
Any `KronScheduler` can be converted to a `Flow<DateTime>` using extension `asFlow`:
|
||||||
|
|
||||||
```kotlin
|
```kotlin
|
||||||
val kronScheduler = buildSchedule {
|
val kronScheduler = buildSchedule {
|
||||||
@ -178,7 +178,7 @@ val kronScheduler = buildSchedule {
|
|||||||
val flow = kronScheduler.asFlow()
|
val flow = kronScheduler.asFlow()
|
||||||
```
|
```
|
||||||
|
|
||||||
So, in this case any operations related to flow are available and it is expected that they will work correctly. For
|
So, in this case any operations related to flow are available, and it is expected that they will work correctly. For
|
||||||
example, it is possible to use this flow with `takeWhile`:
|
example, it is possible to use this flow with `takeWhile`:
|
||||||
|
|
||||||
```kotlin
|
```kotlin
|
||||||
@ -191,7 +191,7 @@ flow.takeWhile {
|
|||||||
|
|
||||||
### Offsets
|
### Offsets
|
||||||
|
|
||||||
Offsets in this library works via passing parameter ending with `o` in any place after `month` config. Currently
|
Offsets in this library works via passing parameter ending with `o` in any place after `month` config. Currently,
|
||||||
there is only one format supported for offsets: minutes of offsets. To use time zones you will need to call `next`
|
there is only one format supported for offsets: minutes of offsets. To use time zones you will need to call `next`
|
||||||
method with `DateTimeTz` argument or `nextTimeZoned` method with any `KronScheduler` instance, but in case if this
|
method with `DateTimeTz` argument or `nextTimeZoned` method with any `KronScheduler` instance, but in case if this
|
||||||
scheduler is not instance of `KronSchedulerTz` it will work like you passed just `DateTime`.
|
scheduler is not instance of `KronSchedulerTz` it will work like you passed just `DateTime`.
|
||||||
@ -211,4 +211,4 @@ Unlike original CRON, here week days:
|
|||||||
* Works as `AND`: cron date time will search first day which will pass requirement according all parameters including
|
* Works as `AND`: cron date time will search first day which will pass requirement according all parameters including
|
||||||
week days
|
week days
|
||||||
* You may use any related to numbers syntax with week days: `0-3w`, `0,1,2,3w`, etc.
|
* You may use any related to numbers syntax with week days: `0-3w`, `0,1,2,3w`, etc.
|
||||||
* Week days (like years and offsets) are optional and can be placed anywhere after `month`
|
* Week days (as well as years and offsets) are optional and can be placed anywhere after `month`
|
||||||
|
Loading…
Reference in New Issue
Block a user