intellibrix v1.0.0
    Preparing search index...

    Type Alias Task

    Represents a Scheduled Task with a name, optional description, schedule, start flag, optional timezone and a method.

    Tasks are powered by the cron package.

    An object of this type can be passed to the Brick.schedule method.

    type Task = {
        cronjob?: CronJob<() => any, null>;
        description?: string;
        method: (brick: Brick) => any;
        name?: string;
        onComplete?: (brick: Brick) => any;
        schedule: string | Date;
        start?: boolean;
        timezone?: string;
    }
    Index
    cronjob?: CronJob<() => any, null>

    An optional CronJob instance associated with the task.

    description?: string

    An optional description of the task.

    method: (brick: Brick) => any

    The method to be executed when the task is run.

    name?: string

    The name of the task.

    onComplete?: (brick: Brick) => any

    The method to be executed when the task is completed.

    schedule: string | Date

    The schedule for the task. This can be a cron string or a Date object.

    start?: boolean

    A flag indicating whether the task should start immediately. If not set to true, you must call task.cronjob.start() manually

    timezone?: string

    An optional timezone for the task.