@AlexTrovato@VonOx For info I did a test to make the .emit function of our global EventEmitter asynchronous!
I was inspired by the code of this library which is quite well known (but well, too complete for us, we don’t need all of that):
It looks like this in terms of code, it’s really very simple:
Basically, each time we emit an event, the event will be published synchronously only « afterwards » — we give Node.js the control to do what it wants between the function call and the synchronous emit.
In the case of devices that would generate hundreds of emits (which themselves would generate hundreds of emits, because we check many things: scenes, websockets to the frontend, etc.), each event is not consumed synchronously, but asynchronously when Node.js can.
This should solve the issues with devices like the Linxee TIC
What do you think?
Edit: @VonOx since it’s a change of a few lines, could you replace the file in your production and see the effect it has, to check if it really solves the issue?