How to break through the limit of self-triggering times in NodeJS eventEmitter callback function

const EventEmitter = require("events")
class MyEmitter extends EventEmitter {}
const myEmitter = new MyEmitter()
let times = 0
myEmitter.on("canReceive", function () {
    console.log(PPtimes)
    myEmitter.emit("canReceive")
})
myEmitter.emit("canReceive")

clipboard.png

Why does the stack overflow? is there any way to trigger it all the time but prevent it from overflowing?

Mar.23,2021

on. It is supposed to be waiting for the trigger time ~


give him some time

myEmitter.on('canReceive', function () {
    console.log(PPtimes)
    setTimeout(function () => {
        myEmitter.emit('canReceive')
    }, 0)
})
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4d61e-43c54.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4d61e-43c54.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?