Object -
task
:
Scheduler
Represents a ballerina task Scheduler, which can be used to run jobs periodically, using the given configurations.
Constructor
__init
(TimerConfiguration | AppointmentConfiguration configurations)
- configurations TimerConfiguration | AppointmentConfiguration
-
A
task:TimerConfiguration
ortask:AppointmentConfiguration
record to define thetask:Sceduler
behavior
Methods
Attaches the provided service
to the task.
Detach the provided service
from the task.
Starts running the task. Task Scheduler will not run until this has been called.
Stops the task. This will stop, after finish running the existing jobs.
Pauses the task.
Resumes a paused task.
Checks whether the task listener is started or not.
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 needs to passed inside the resources.
-
Return Type
(SchedulerError?) Returns
task:SchedulerError
if the process failed due to any reason, nil otherwise.
Detach the provided service
from the task.
Parameters
- attachedService service
-
ballerina
service
object which needs to be detached from the task.
-
Return Type
(SchedulerError?) Returns
task:SchedulerError
if the process failed due to any reason, nil otherwise.
Starts running the task. Task Scheduler will not run until this has been called.
-
Return Type
(SchedulerError?) Returns
task:SchedulerError
if the process failed due to any reason, nil otherwise.
Stops the task. This will stop, after finish running the existing jobs.
-
Return Type
(SchedulerError?) Returns
task:SchedulerError
if the process failed due to any reason, nil otherwise.
Pauses the task.
-
Return Type
(SchedulerError?) Returns
task:SchedulerError
if an error is occurred while resuming, nil Otherwise.
Resumes a paused task.
-
Return Type
(SchedulerError?) Returns
task:SchedulerError
when an error occurred while pausing, nil Otherwise.