Skip to content

Commit

Permalink
fix: possible delays in slower systems
Browse files Browse the repository at this point in the history
Fixes #2676
  • Loading branch information
robertsLando committed Sep 26, 2022
1 parent 7296213 commit 3021f91
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ZwaveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,10 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {
*/
sendToSocket(evtName: string, data: any) {
if (this.socket) {
this.socket.emit(evtName, data)
// break the sync loop to let the event loop continue #2676
process.nextTick(() => {
this.socket.emit(evtName, data)
})
}
}

Expand Down

0 comments on commit 3021f91

Please sign in to comment.