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

  • idnumber ID number of job
  • knexKnex Knex instance to use
  • tableOptionsTableOptions Table options including names
  • pollMsnumber Poll interval
  • txKnex.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
  • optionsTableOptions Job options
  • dataobject Job data

add

Adds a single or recurring job to the queue

Parameters

  • dataobject Job data to be passed to the processing function
  • optionsJobOptions 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

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