ScheduleEphemeralTask (open)
Schedule an ephemeral task if this transaction commits
Syntax
LOADLIB "mod::system/lib/tasks.whlib";
OBJECT FUNCTION ScheduleEphemeralTask(STRING tasktype, RECORD taskdata, RECORD options)Parameters
STRING tasktypeType of the task to schedule - refers to to the servicemanager:ephemeraltask in the moduledefinition
RECORD taskdataData for the task
RECORD optionsOptions
RECORD auxdataAuxilliary data cells. This will be merged with the task data when passed to the task, but stored separately to avoid the 4K limit
STRING persistentcachekeyKey for the persistent cache of the task (available via taskcontext.persistentcache)
STRING priorityOverride the default task priority for this task type. Allowed values: '', 'background', 'normal', 'interactive', 'update', 'updateinteractive'.
Return value
OBJECTPromise that will complete when the task is done, and returns the tasks value or an exception if the task failed
Description
An ephemeral task may be lost if the current script, the task itself or the task manager fails or ends Ephemeral tasks are often used when work needs to be done asynchronously, but the current script still needs the results. If the current script goes away, it's assumed that the task can go away and will not have any side effects.