prorm API Reference
    Preparing search index...

    Class BeanstalkdStore

    BeanstalkdStore wraps a single fivebeans client and exposes the common queue surface (enqueue/process/getJob/remove/stats) over Beanstalkd tubes, promisifying the driver's callback API.

    Implements

    Index
    name: "beanstalkd" = 'beanstalkd'

    The name of the store (e.g. 'mongodb', 'redis', 'dynamodb')

    library: "fivebeans" = 'fivebeans'

    The client library being used

    • Enqueue a job into a tube. Selects the tube via use(), then put()s the (JSON-serialized) payload with the given priority/delay/ttr. Returns the job id assigned by the server.

      Parameters

      • queue: string
      • jobData: unknown
      • opts: BeanstalkdPutOptions = {}

      Returns Promise<string>

    • Register a worker on a tube: watch() it, then loop reserve()ing jobs and invoking handler(job). After the handler resolves the job is destroy()ed. The loop stops when the store disconnects.

      Parameters

      • queue: string
      • handler: (job: BeanstalkdJob) => void | Promise<void>

      Returns Promise<void>

    • Peek at a job by id, returning its id and payload (or null if absent).

      Parameters

      • _queue: string
      • id: string

      Returns Promise<BeanstalkdJob | null>

    • Delete (destroy) a job by id.

      Parameters

      • _queue: string
      • id: string

      Returns Promise<void>

    • Return per-tube statistics (stats-tube), e.g. ready/reserved/buried counts.

      Parameters

      • queue: string

      Returns Promise<any>