All,
I noticed there were some recent changes made to the Gremlin-Javascript GLV regarding how to close a connection that was created using the Driver Remote Connection. In 3.3.2 and prior, you could just do the following:
const gremlin = require('gremlin');
const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection;
const Graph = gremlin.structure.Graph;
dc = new DriverRemoteConnection('wss://graph-db-endpoint:8182');
const graph = new Graph();
const g = graph.traversal().withRemote(dc);
// << do something / traverse graph >>
dc.close();
In this case dc.close() could be called synchronously even though it was using a Promise internally to issue the closure of the websocket. There was no need to handle any returning Promise, correct? Looks like there is one case where a Promise could have been returned (if the connection was already closed?), but in most cases this would not return anything.
Starting in 3.3.4, dc.close() returns a Promise regardless of the state of the connection (whether or not this is the first call to close the connection, or a subsequent call after the connection is already closed). Given this, should we be handling the returned Promise to make sure the connection has completely closed? It doesn't appear that there is a lot of documentation around this. I just wanted to validate the thinking here:
Thanks in advance!