Nobody Pays (for) Magazines

    @apio/gravity-worker

    1.0.1 • Public • Published

    Apio Gravity Worker Helper

    Helps you implement gravity job workers:

    const {Worker} = require('/path/to/apio-gravity-worker/index.js')
    
    const w = new Worker({
          topic: 'project.resource.action',
          scheduling: '* * * * *',
          gravityUrl: config.gravityBaseUrl
    })
    
    // React to a job
    w.on('job', async job => {
      console.log("New job received",job)
    })
    
    // Starts the cron
    w.start()
    
    // Not waiting for the first cron tick running it right away
    w.dequeue()

    Keywords

    none

    Install

    npm i @apio/gravity-worker

    DownloadsWeekly Downloads

    0

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    8.02 kB

    Total Files

    8

    Last publish

    Collaborators

    • fatmatto
    • matteodisabatino