Object -
task
:
Scheduler
Represents a ballerina task Scheduler, which can be used to run jobs periodically, using the given configurations.
Constructor
__init
(TimerConfiguration | AppointmentConfiguration configuration)
- configuration TimerConfiguration | AppointmentConfiguration
-
The
task:TimerConfiguration
ortask:AppointmentConfiguration
record to define thetask:Sceduler
behavior
Methods
Attaches the provided service
to the task.
Parameters
- serviceToAttach service
-
Ballerina
service
object, which needs to be attached to the task
- attachments any...
-
Set of optional parameters, which need to be passed inside the resources
-
Return Type
(SchedulerError?) A
task:SchedulerError
if the process failed due to any reason or else ()
Detaches the provided service
from the task.
Parameters
- attachedService service
-
Ballerina
service
object, which needs to be detached from the task
-
Return Type
(SchedulerError?) A
task:SchedulerError
if the process failed due to any reason or else ()
Starts running the task. Task Scheduler will not run until this has been called.
-
Return Type
(SchedulerError?) A
task:SchedulerError
if the process failed due to any reason or else ()
Stops the task. This will stop after running the existing jobs.
-
Return Type
(SchedulerError?) A
task:SchedulerError
if the process failed due to any reason or else ()
Pauses the task.
-
Return Type
(SchedulerError?) A
task:SchedulerError
if an error is occurred while pausing or else ()
Resumes a paused task.
-
Return Type
(SchedulerError?) A
task:SchedulerError
when an error occurred while resuming or else ()