Skip to content
This repository has been archived by the owner on Jan 10, 2021. It is now read-only.

Commit

Permalink
Stream: Pass the callback to ws.send instead of calling it synchronously
Browse files Browse the repository at this point in the history
  • Loading branch information
orgads committed Jun 4, 2020
1 parent 1f28d76 commit 62ac535
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/StreamingClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ export class StreamingClient extends Writable {
_write(chunk: any, _: string, cb: any) {
const binary = toBinary(chunk)

this.ws.readyState === 1 && this.ws.send(binary)
cb()
this.ws.readyState === 1 && this.ws.send(binary, cb)
}

/**
Expand Down

0 comments on commit 62ac535

Please sign in to comment.