Closed mtharrison closed 6 years ago
Looks good, but curious if the await inside the loop is on purpose? Is it not more efficient to kick off the processing of every item in parallel, rather than one by one?
It's an interesting question. The docs state that eachSocket()
is "synchronous", which is obviously no longer true but I sort of assumed it to imply that the each
will be called serially on each socket.
For publish, I can't see any reason why you wouldn't want to publish on all sockets in parallel, unless say, your filter mechanism was demanding on resources. But that would be bad design on the application side anyway.
As this is definitely a bug with current code anyway, I'll merge and open an issue to investigate the above questions more.
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
@dominykas can you take a look to see if this makes sense please?
Closes #232