purge.js 289 B

123456789101112
  1. 'use strict'
  2. const { TimeoutError } = require('../../errors')
  3. /**
  4. * Flushes the queue by rejecting all pending requests with a timeout error.
  5. */
  6. module.exports = function purge () {
  7. this.flush(function flushCB (a, b, c, cb) {
  8. cb(new TimeoutError('request queue timeout'))
  9. })
  10. }