Rest
...args: any[]v0.1.26
Private
Readonly
#Private
Readonly
#emitSynchronously calls each of the listeners registered for the event namedeventName
, in the order they were registered, passing the supplied arguments
to each.
Returns true
if the event had listeners, false
otherwise.
import { EventEmitter } from 'node:events';
const myEmitter = new EventEmitter();
// First listener
myEmitter.on('event', function firstListener() {
console.log('Helloooo! first listener');
});
// Second listener
myEmitter.on('event', function secondListener(arg1, arg2) {
console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
});
// Third listener
myEmitter.on('event', function thirdListener(...args) {
const parameters = args.join(', ');
console.log(`event with parameters ${parameters} in third listener`);
});
console.log(myEmitter.listeners('event'));
myEmitter.emit('event', 1, 2, 3, 4, 5);
// Prints:
// [
// [Function: firstListener],
// [Function: secondListener],
// [Function: thirdListener]
// ]
// Helloooo! first listener
// event with parameters 1, 2 in second listener
// event with parameters 1, 2, 3, 4, 5 in third listener
Rest
...args: any[]v0.1.26
Private
#isPrivate
Readonly
#optionsPrivate
Optional
#randomPrivate
Optional
#runningReadonly
nodeOptional
pubStatic
Private
#SLOTSPrivate
#clientOptional
options: RedisClusterClientOptionsOptional
disableReconnect: booleanPrivate
#createPrivate
#createPrivate
#destroyPrivate
#discoverOptional
rootNode: RedisClusterClientOptionsPrivate
#discoverPrivate
#execPrivate
#getPrivate
#getOptional
rootNode: RedisClusterClientOptionsPrivate
#initiateOptional
toResubscribe: PubSubToResubscribePrivate
#initiatePrivate
#initiatePrivate
#iteratePrivate
#rediscoverPrivate
#resetPrivate
#slotGenerated using TypeDoc
Synchronously calls each of the listeners registered for the event named
eventName
, in the order they were registered, passing the supplied arguments to each.Returns
true
if the event had listeners,false
otherwise.