enqueueKronSchedulerWork

suspend fun <T : KronSchedulerWork> Context.enqueueKronSchedulerWork(    workName: String,     delayMillis: Long,     workClass: Class<T>,     existingWorkPolicy: ExistingWorkPolicy = ExistingWorkPolicy.REPLACE,     setUpRequest: suspend OneTimeWorkRequest.Builder.() -> Unit = {}): Operation

This method will enqueue OneTimeWorkRequest with workName and existingWorkPolicy. Use setUpRequest callback in case you need some additional actions to do before request will be enqueued


inline suspend fun <T : KronSchedulerWork> Context.enqueueKronSchedulerWork(    workName: String,     delayMillis: Long,     existingWorkPolicy: ExistingWorkPolicy = ExistingWorkPolicy.REPLACE,     noinline setUpRequest: suspend OneTimeWorkRequest.Builder.() -> Unit = {}): Operation

This method is shortcut for enqueueKronSchedulerWork with reified T parameter


suspend fun <T : KronSchedulerWork> Context.enqueueKronSchedulerWork(    workName: String,     initialScheduler: KronScheduler,     workClass: Class<T>,     existingWorkPolicy: ExistingWorkPolicy = ExistingWorkPolicy.REPLACE,     setUpRequest: suspend OneTimeWorkRequest.Builder.() -> Unit = {}): Operation?

This method is shortcut for enqueueKronSchedulerWork with initialScheduler. It will try to calculate delay by itself. In case if KronScheduler.next of initialScheduler will return null, work WILL NOT be enqueued

Return

null in case if KronScheduler.next of initialScheduler has returned null and work has not been enqueued


inline suspend fun <T : KronSchedulerWork> Context.enqueueKronSchedulerWork(    workName: String,     initialScheduler: KronScheduler,     existingWorkPolicy: ExistingWorkPolicy = ExistingWorkPolicy.REPLACE,     noinline setUpRequest: suspend OneTimeWorkRequest.Builder.() -> Unit = {}): Operation?

This method is shortcut for enqueueKronSchedulerWork with reified T

Sources

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard