yahtnif / foke

Simple job queues, with dash server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

foke

npm LICENSE

Simple job queues, with dash server.

Install

yarn add foke
# or
npm install foke

Usage

const Foke = require('foke')

// default options
const foke = new Foke({
  // looking for jobs that need to be processed
  interval: '1s', // default: '5s'
  maxRuntime: '1h',
  dash: true, // default: false
  dashLogger: false,
  dashPort: 8641 // http://localhost:8641
})

let i = 0

foke.add({
  name: 'test',
  // lock lifetime
  maxRuntime: '1h',
  interval: '2s', // default: '1m'
  priority: 0,
  action() {
    console.log(new Date())
    if (i++ > 3) {
      foke.stop()
      console.log('DONE')
    }
  }
})

foke.start()

License

Anti 996

About

Simple job queues, with dash server.

License:Other


Languages

Language:JavaScript 100.0%