hapijs / nes

WebSocket adapter plugin for hapi routes
Other
503 stars 87 forks source link

Ignored removed items during publish #233

Closed mtharrison closed 6 years ago

mtharrison commented 6 years ago

@dominykas can you take a look to see if this makes sense please?

Closes #232

dominykas commented 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?

mtharrison commented 6 years ago

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.

lock[bot] commented 4 years ago

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.