-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathScheduler.scala
More file actions
22 lines (18 loc) · 770 Bytes
/
Scheduler.scala
File metadata and controls
22 lines (18 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package com.github.sideeffffect.quartz
import org.quartz.{CronExpression, JobDetail, JobKey, Trigger, TriggerBuilder}
import java.time.Instant
trait Scheduler[A, F[_]] {
def scheduleJob(trigger: Trigger): F[Instant]
def scheduleJob(jobDetail: JobDetail, trigger: Trigger): F[Instant]
def checkExists(jobKey: JobKey): F[Boolean]
def deleteJob(jobKey: JobKey): F[Boolean]
}
trait SchedulerCustom[A, F[_]] extends Scheduler[A, F] {
def scheduleJobCustom(jobKey: JobKey, jobData: A, cronExpression: CronExpression): F[Unit]
def scheduleJobCustom(jobKey: JobKey, jobData: A, instant: Instant): F[Unit]
def scheduleJobCustom(
jobKey: JobKey,
jobData: A,
configure: TriggerBuilder[Trigger] => TriggerBuilder[? <: Trigger],
): F[Instant]
}