Otanikotani opened a new pull request #1303:
URL: https://github.com/apache/tinkerpop/pull/1303


   The goal of this PR is to provide a capability to specify arguments on query 
submission via JS Client. In our use case we would like to be able to specify 
`scriptEvaluationTimeout` argument for certain queries (which we expect to be 
slow and we want to prevent accidental timeouts). 
   
   I am by no means a JS expert, hence probably adding extraArgs as an argument 
to the `submit` function is not ideal, but with this change we can write 
something like this to increase the timeout:
   
   ```js
   const gremlin = require('gremlin');
   
   const traversal = gremlin.process.AnonymousTraversalSource.traversal;
   const p = gremlin.process.P;
   const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection;
   
   const Client = gremlin.driver.Client;
   
   const client = new Client('<endpoint>','gmodern')
   client.open();
   message = `<very-long-query>`
   
   client.submit(message, null, {"scriptEvaluationTimeout": 
60000}).catch(function(error) {
     console.log("BOOOM ERROR!");
     console.log(error);
   }).then(function (result) {
     console.log(result);
   });
   
   client.close();
   ```
   
   Also, just to clarify - we can't use Java Client (where specifying arguments 
seems to be supported) as this is used in AWS JS Lambda -> AWS Neptune 
interaction. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to