Pulse
GithubCloud(Pulsecron)
  • What is Pulse?
  • Why Pulse?
  • Quick Start
  • DOCS
    • Setup & Config
      • Connection
      • Config
        • Name
        • ProcessEvery
        • DefaultConcurrency
        • MaxConcurrency
        • LockLimit
        • DefaultLockLimit
        • DefaultLockLifetime
        • Sort
        • ResumeOnRestart
    • Defining Job Processors
    • Managing Job Processor
      • Start
      • Stop
    • Creating Jobs
      • Every
      • Schedule
      • Now
      • Create
    • Managing Jobs
      • Jobs
      • Cancel
      • Disable
      • Enable
      • Purge
      • isRunning
      • isExpired
      • Manually working
        • Save
        • Unique
        • RepeatEvery
        • RepeatAt
        • Schedule
        • Remove
        • Priority
        • Touch
        • SetShouldSaveResult
        • Fail
        • Run
        • Disable
        • Enable
Powered by GitBook
On this page
  • pulse.start()
  • Example Usage
  • Returns
  • Notes

Was this helpful?

Edit on GitHub
  1. DOCS
  2. Managing Job Processor

Start

pulse.start()

The start method activates the job queue, beginning the regular processing of jobs based on the interval specified in the processEvery method. This is a crucial method to call after setting up job intervals and before scheduling any jobs to ensure the job queue operates correctly.

Example Usage

const pulse = new Pulse();

pulse.processEvery(100);

pulse.start(); // It should be in this position See NOTES section at the page

pulse.every('1 day', 'dailyReport', { reportId: 123 });

Returns

  • Promise<void | unknown>: A promise that resolves when the database has been set up beforehand and the job processing begins. If the job queue has already been started, the promise resolves with the previously set ready state.

Notes

  • Idempotence: If start is called multiple times, subsequent calls will recognize that processing has already been initiated and will not create additional intervals.

PreviousManaging Job ProcessorNextStop

Last updated 1 year ago

Was this helpful?

Pre-requisite: start must be called after (e.g. processEvery) is set and ideally before scheduling any jobs with methods like every or schedule.

config method