Shimi / graphite-client

Node.js client for Graphite http://shimi.github.io/graphite-client/
Apache License 2.0
3 stars 7 forks source link

write does not callback on success #3

Open gregbellingham opened 7 years ago

gregbellingham commented 7 years ago

When supplying a callback to the write function, the callback is only fired when an exception is caught. The issue lies with the call to socket.write on line 64: this.socket.write(lines), to which additional parameters should be supplied: this.socket.write(lines, this.encoding, callback). This modification will ensure that completion of the socket write also fires the callback.

gregbellingham commented 7 years ago

@Shimi - I have a branch that fixes this, provided you would be open to allowing a git push and a pull request. No authorization at present.

Shimi commented 7 years ago

@gregbellingham I see why there is a confusion, the call back in teh code s provided for error handling and not for the write function. Can you create a pull request for the change?