Provides cron-related utility functions based on the cron format for use in HotMesh mapping rules.

Invoked in mapping rules using {@cron.<method>} syntax.

Constructors

Methods

Constructors

Methods

  • Calculates the delay in seconds until the next execution of a cron job. Throws on invalid expressions rather than degrading silently.

    Parameters

    • cronExpression: string

      The cron expression to parse (e.g. '0 0 * * *')

    Returns number

    The delay in seconds until the next cron job execution (minimum HMSH_FIDELITY_SECONDS)

    If the cron expression is invalid

    cron_next_result:
    "@pipe":
    - ["{a.expressions.cron}"]
    - ["{@cron.nextDelay}"]