ManagedTaskBase (open)

Base class to implement managed tasks

Syntax

LOADLIB "mod::system/lib/tasks.whlib";

OBJECTTYPE ManagedTaskBase

Variables

  • BOOLEAN debug

    Whether debugging is enabled for this task

  • STRING mutex

    If set, mutex to lock in the work that is opened around ExecuteTask

Functions

  • RECORD FUNCTION GetTaskMetadata()

    Returns the task metadata

  • MACRO PrepareTask(RECORD data)

    Override PrepareTask with your task preparation code code. This function is called without work, and can be used to do long I/O. Result data can be stored in the current object. Throw exceptions if something fails and you want to be restarted. No database work is opened when this function runs

  • MACRO RunTask(RECORD data)

    Override RunTask with your task code. This function is run with open work, so keep I/O to a minimum (use PrepareTask instead). Throw exceptions if something fails and you want to be restarted, and use ResolveByRestart for a graceful continuation later