Skip to content

Latest commit

 

History

History
140 lines (84 loc) · 2.55 KB

File metadata and controls

140 lines (84 loc) · 2.55 KB

Table of Contents

setupTables

Sets up tables in a PostgreSQL database.

Parameters

  • knex Knex instance to use to setup tables.
  • options Specifies table names and other options

dropTables

Drops tables from PostgreSQL database.

Parameters

  • knex Knex instance to use to drop tables
  • options Specifies table names

Job

Represents a single or recurring job by ID.

Parameters

  • id number ID number of job
  • knex Knex Knex instance to use
  • tableOptions TableOptions Table options including names
  • pollMs number Poll interval
  • tx Knex.Transaction Transaction if applicable (inside processing function)

Properties

done

Waits for a job to complete (only applicable to non-recurring jobs)

remove

Removes job from queue

Queue

This represents a single queue.

Parameters

  • name
  • knex
  • options TableOptions Job options
  • data object Job data

add

Adds a single or recurring job to the queue

Parameters

  • data object Job data to be passed to the processing function
  • options JobOptions Job options for configuring repeat and output handling

getJob

Gets a Job object from the queue.

Parameters

process

Process runs the queue and processes jobs.

Parameters

  • cb Function Callback to handle a job. Return value should be job result.