Optionalreason: stringOptionalreason: stringBullMQ-compatible delay(milliseconds?, abortController?). Omitted, null, 0 or a
negative value resolves at once (as on 2.9.10 and in BullMQ), and a numeric string
is that number; NaN, Infinity and another non-number reject. Any longer delay is honoured exactly. Aborting, or passing a
controller that is already aborted, rejects with Delay aborted.
Optionalmilliseconds: numberOptionalabortController: AbortControllerRenew the leases of jobIds for duration ms from now. Like lockDuration, the
duration must be finite and >= 1: the broker sets the expiry to now + duration, so
0 or less expires the lease and NaN or Infinity would make it never expire. As on
2.9.10, an omitted or null duration renews each lease with its own TTL, a numeric
string is that number, and a closed Worker or an empty jobIds returns 0 before
any check.
Adds the listener function to the end of the listeners array for the
event named eventName. No checks are made to see if the listener has
already been added. Multiple calls passing the same combination of eventName
and listener will result in the listener being added, and called, multiple
times.
server.on('connection', (stream) => {
console.log('someone connected!');
});
Returns a reference to the EventEmitter, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The
emitter.prependListener() method can be used as an alternative to add the
event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.on('foo', () => console.log('a'));
myEE.prependListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// a
The callback function
Adds a one-time listener function for the event named eventName. The
next time eventName is triggered, this listener is removed and then invoked.
server.once('connection', (stream) => {
console.log('Ah, we have our first user!');
});
Returns a reference to the EventEmitter, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The
emitter.prependOnceListener() method can be used as an alternative to add the
event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.once('foo', () => console.log('a'));
myEE.prependOnceListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// a
The callback function
Block new starts for expireTimeMs. As on 2.9.10 (BullMQ v5), a value that is not
a positive finite number (0, negative, NaN, Infinity, null) does nothing, and a
numeric string is that number; any other non-number throws a TypeError. A wait
above the native timer limit parks the pull loop on a safeTimeout instead of
spinning.
StaticRate
As on 2.9.10 (
Math.max(1, value)): values below 1 andnullare clamped to 1 (documented), a fraction rounds up (the gate isactive >= concurrency), Infinity removes the limit and a numeric string is that number. NaN (the gate would never close) or another non-number throws.