Package io.quarkus.scheduler
Interface Scheduler.JobDefinition
-
- Enclosing interface:
- Scheduler
public static interface Scheduler.JobDefinitionThe job definition is a builder-like API that can be used to define a job programmatically.No job is scheduled until the
setTask(Consumer)orsetAsyncTask(Function)method is called.The implementation is not thread-safe and should not be reused.
-
-
Method Summary
-
-
-
Method Detail
-
setCron
Scheduler.JobDefinition setCron(String cron)
The schedule is defined either bysetCron(String)or bysetInterval(String). If both methods are used, then the cron expression takes precedence.- Parameters:
cron-- Returns:
- self
- See Also:
Scheduled.cron()
-
setInterval
Scheduler.JobDefinition setInterval(String every)
The schedule is defined either bysetCron(String)or bysetInterval(String). If both methods are used, then the cron expression takes precedence.- Parameters:
every-- Returns:
- self
- See Also:
Scheduled.every()
-
setDelayed
Scheduler.JobDefinition setDelayed(String period)
- Parameters:
period-- Returns:
- self
- See Also:
Scheduled.delayed()
-
setConcurrentExecution
Scheduler.JobDefinition setConcurrentExecution(Scheduled.ConcurrentExecution concurrentExecution)
- Parameters:
concurrentExecution-- Returns:
- self
- See Also:
Scheduled.concurrentExecution()
-
setSkipPredicate
Scheduler.JobDefinition setSkipPredicate(Scheduled.SkipPredicate skipPredicate)
- Parameters:
skipPredicate-- Returns:
- self
- See Also:
Scheduled.skipExecutionIf()
-
setOverdueGracePeriod
Scheduler.JobDefinition setOverdueGracePeriod(String period)
- Parameters:
period-- Returns:
- self
- See Also:
Scheduled.overdueGracePeriod()
-
setTimeZone
Scheduler.JobDefinition setTimeZone(String timeZone)
- Returns:
- self
- See Also:
Scheduled.timeZone()
-
setTask
default Scheduler.JobDefinition setTask(Consumer<ScheduledExecution> task)
- Parameters:
task-- Returns:
- self
-
setTask
Scheduler.JobDefinition setTask(Consumer<ScheduledExecution> task, boolean runOnVirtualThread)
Configures the task to schedule.- Parameters:
task- the task, must not benullrunOnVirtualThread- whether the task must be run on a virtual thread if the JVM allows it.- Returns:
- self the current job definition
-
setAsyncTask
Scheduler.JobDefinition setAsyncTask(Function<ScheduledExecution,io.smallrye.mutiny.Uni<Void>> asyncTask)
- Parameters:
asyncTask-- Returns:
- self
-
schedule
Trigger schedule()
Attempts to schedule the job.- Returns:
- the trigger
-
-