You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by GitBox <gi...@apache.org> on 2020/07/13 21:11:19 UTC
[GitHub] [tinkerpop] Otanikotani opened a new pull request #1303: Add support to provide extra arguments to the Client.submit()
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:
users@infra.apache.org
[GitHub] [tinkerpop] spmallette commented on pull request #1303: Add support to provide extra arguments to the Client.submit()
Posted by GitBox <gi...@apache.org>.
spmallette commented on pull request #1303:
URL: https://github.com/apache/tinkerpop/pull/1303#issuecomment-668637246
Merged and added some documentation.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [tinkerpop] spmallette commented on pull request #1303: Add support to provide extra arguments to the Client.submit()
Posted by GitBox <gi...@apache.org>.
spmallette commented on pull request #1303:
URL: https://github.com/apache/tinkerpop/pull/1303#issuecomment-658861051
thanks for the contribution @Otanikotani - i'm sure @jorgebay will take a look at this when he gets a moment.
As a side note, I think this is also an issue in other GLVs as well: https://issues.apache.org/jira/browse/TINKERPOP-2296
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [tinkerpop] spmallette merged pull request #1303: Add support to provide extra arguments to the Client.submit()
Posted by GitBox <gi...@apache.org>.
spmallette merged pull request #1303:
URL: https://github.com/apache/tinkerpop/pull/1303
----------------------------------------------------------------
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:
users@infra.apache.org