mirror of
https://github.com/InsanusMokrassar/krontab.git
synced 2024-11-22 16:23:55 +00:00
update dependencies and remove deprecations
This commit is contained in:
parent
06107f75f2
commit
0bfe022476
@ -2,6 +2,13 @@
|
|||||||
|
|
||||||
## 0.7.0
|
## 0.7.0
|
||||||
|
|
||||||
|
**ALL DEPRECATIONS HAVE BEEN REMOVED**
|
||||||
|
|
||||||
|
* Versions
|
||||||
|
* `Kotlin`: `1.6.0`
|
||||||
|
* `Coroutines`: `1.6.0-RC`
|
||||||
|
* `Androidx Work`: `2.7.1`
|
||||||
|
|
||||||
## 0.6.6
|
## 0.6.6
|
||||||
|
|
||||||
* Versions
|
* Versions
|
||||||
|
@ -134,7 +134,6 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
toolchain {
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
languageVersion = JavaLanguageVersion.of(8)
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,8 @@ android.useAndroidX=true
|
|||||||
android.enableJetifier=false
|
android.enableJetifier=false
|
||||||
|
|
||||||
|
|
||||||
kotlin_version=1.5.31
|
kotlin_version=1.6.0
|
||||||
kotlin_coroutines_version=1.5.2
|
kotlin_coroutines_version=1.6.0-RC
|
||||||
|
|
||||||
dokka_version=1.5.31
|
dokka_version=1.5.31
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ junit_version=4.12
|
|||||||
test_ext_junit_version=1.1.2
|
test_ext_junit_version=1.1.2
|
||||||
espresso_core=3.3.0
|
espresso_core=3.3.0
|
||||||
|
|
||||||
androidx_work_version=2.7.0
|
androidx_work_version=2.7.1
|
||||||
|
|
||||||
## Common
|
## Common
|
||||||
|
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
|
||||||
|
@ -36,23 +36,3 @@ internal fun mergeCronDateTimeSchedulers(
|
|||||||
): CronDateTimeScheduler = CronDateTimeScheduler(
|
): CronDateTimeScheduler = CronDateTimeScheduler(
|
||||||
schedulers.map { it.cronDateTime }.merge()
|
schedulers.map { it.cronDateTime }.merge()
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
|
||||||
* @return New instance of [CronDateTimeScheduler] with all unique [CronDateTimeScheduler.cronDateTimes] of
|
|
||||||
* [kronSchedulers] included
|
|
||||||
*/
|
|
||||||
@Deprecated("Will be removed in next major release", ReplaceWith("merge", "dev.inmo.krontab"))
|
|
||||||
fun merge(kronSchedulers: List<KronScheduler>) = kronSchedulers.apply { dev.inmo.krontab.merge() }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Vararg shortcut for [dev.inmo.krontab.merge]
|
|
||||||
*/
|
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
|
||||||
@Deprecated("Will be removed in next major release", ReplaceWith("merge", "dev.inmo.krontab"))
|
|
||||||
inline fun merge(vararg kronDateTimeSchedulers: KronScheduler) = kronDateTimeSchedulers.apply { dev.inmo.krontab.merge() }
|
|
||||||
/**
|
|
||||||
* @return Vararg shortcut for [dev.inmo.krontab.merge]
|
|
||||||
*/
|
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
|
||||||
@Deprecated("Will be removed in next major release", ReplaceWith("merge", "dev.inmo.krontab"))
|
|
||||||
inline fun KronScheduler.plus(other: KronScheduler) = this + other
|
|
||||||
|
@ -3,8 +3,7 @@ package dev.inmo.krontab.utils
|
|||||||
import com.soywiz.klock.DateTime
|
import com.soywiz.klock.DateTime
|
||||||
import com.soywiz.klock.DateTimeTz
|
import com.soywiz.klock.DateTimeTz
|
||||||
import dev.inmo.krontab.*
|
import dev.inmo.krontab.*
|
||||||
import kotlinx.coroutines.FlowPreview
|
import kotlinx.coroutines.*
|
||||||
import kotlinx.coroutines.delay
|
|
||||||
import kotlinx.coroutines.flow.*
|
import kotlinx.coroutines.flow.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -33,23 +32,3 @@ fun KronScheduler.asFlow(): Flow<DateTime> = channelFlow {
|
|||||||
send(it)
|
send(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated(
|
|
||||||
"It is not recommended to use this class in future. This functionality will be removed soon",
|
|
||||||
ReplaceWith("asFlow", "dev.inmo.krontab.utils.asFlow")
|
|
||||||
)
|
|
||||||
@FlowPreview
|
|
||||||
class SchedulerFlow(
|
|
||||||
private val scheduler: KronScheduler
|
|
||||||
) : AbstractFlow<DateTime>() {
|
|
||||||
@FlowPreview
|
|
||||||
override suspend fun collectSafely(collector: FlowCollector<DateTime>) {
|
|
||||||
while (true) {
|
|
||||||
val now = DateTime.now()
|
|
||||||
val nextTime = scheduler.next(now) ?: break
|
|
||||||
val sleepDelay = (nextTime - now).millisecondsLong
|
|
||||||
delay(sleepDelay)
|
|
||||||
collector.emit(nextTime)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user