Description
When running this code sample, lambda function never ends because connection is not closed.
Then adding a client.closeConnection() throws the following error TypeError: this.connection.close is not a function at GremlinClient.closeConnection (/var/task/node_modules/gremlin/lib/GremlinClient.js:119:21)
Fix
Adding directly client.connection.ws.close(); within the sample's callback makes the code sample work.
In the same manner, at https://github.com/jbmusso/gremlin-javascript/blob/master/gremlin-client/src/GremlinClient.js#L83, replacing this.connection.close() by this.connection.ws.close() makes also the code sample work (but I don't know if it follows well current coding project pattern).
Bonus
As a best practice, adding the close connection feature to documentation samples.
Execution environment AWS Lambda Node (node v6.3)
Code sample
Description When running this code sample, lambda function never ends because connection is not closed. Then adding a
client.closeConnection()
throws the following errorTypeError: this.connection.close is not a function at GremlinClient.closeConnection (/var/task/node_modules/gremlin/lib/GremlinClient.js:119:21)
Fix Adding directly
client.connection.ws.close();
within the sample's callback makes the code sample work. In the same manner, at https://github.com/jbmusso/gremlin-javascript/blob/master/gremlin-client/src/GremlinClient.js#L83, replacingthis.connection.close()
bythis.connection.ws.close()
makes also the code sample work (but I don't know if it follows well current coding project pattern).Bonus As a best practice, adding the close connection feature to documentation samples.