Object - task : Scheduler

Represents a ballerina task.

attach

(service serviceToAttach, any attachment)

returns error?

Attaches the provided service to the task.

Parameters

  • serviceToAttach service
  • Service which needs to be attached to the task.

  • attachment any - ()
  • An optional parameter which needs to passed inside the resources.

  • Return Type

    (error?)
  • Returns error if the process failed due to any reason, nil otherwise.

detach

(service attachedService)

returns error?

Detach the provided service from the task.

Parameters

  • attachedService service
  • service which needs to be detached from the task.

  • Return Type

    (error?)
  • Returns error if the process failed due to any reason, nil otherwise.

start

()

returns error?

Starts running the task. Task will not run until this has been called.

  • Return Type

    (error?)
  • Returns error if the process failed due to any reason, nil otherwise.

stop

()

returns error?

Stops the task. This will stop, after finish running the existing jobs.

  • Return Type

    (error?)
  • Returns error if the process failed due to any reason, nil otherwise.

pause

()

returns error?

Pauses the task.

  • Return Type

    (error?)
  • Returns error if an error is occurred while resuming, nil Otherwise.

resume

()

returns error?

Resumes a paused task.

  • Return Type

    (error?)
  • Returns error when an error occurred while pausing, nil Otherwise.