Class GremlinClientExtensions
Provides extension methods for the IGremlinClient interface.
Inheritance
Inherited Members
Namespace: Gremlin.Net.Driver
Assembly: cs.temp.dll.dll
Syntax
public static class GremlinClientExtensions
Methods
SubmitAsync(IGremlinClient, RequestMessage, CancellationToken)
Submits a request message as an asynchronous operation without returning the result received from the Gremlin Server.
Declaration
public static async Task SubmitAsync(this IGremlinClient gremlinClient, RequestMessage requestMessage, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
IGremlinClient | gremlinClient | The IGremlinClient that submits the request. |
RequestMessage | requestMessage | The |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The task object representing the asynchronous operation. |
Exceptions
Type | Condition |
---|---|
ResponseException | Thrown when a response is received from Gremlin Server that indicates that an error occurred. |
SubmitAsync(IGremlinClient, String, Dictionary<String, Object>, CancellationToken)
Submits a request message that consists of a script with bindings as an asynchronous operation without returning the result received from the Gremlin Server.
Declaration
public static async Task SubmitAsync(this IGremlinClient gremlinClient, string requestScript, Dictionary<string, object> bindings = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
IGremlinClient | gremlinClient | The IGremlinClient that submits the request. |
System.String | requestScript | The Gremlin request script to send. |
Dictionary<System.String, System.Object> | bindings | Bindings for parameters used in the requestScript. |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The task object representing the asynchronous operation. |
Exceptions
Type | Condition |
---|---|
ResponseException | Thrown when a response is received from Gremlin Server that indicates that an error occurred. |
SubmitAsync<T>(IGremlinClient, String, Dictionary<String, Object>, CancellationToken)
Submits a request message that consists of a script with bindings as an asynchronous operation.
Declaration
public static async Task<ResultSet<T>> SubmitAsync<T>(this IGremlinClient gremlinClient, string requestScript, Dictionary<string, object> bindings = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
IGremlinClient | gremlinClient | The IGremlinClient that submits the request. |
System.String | requestScript | The Gremlin request script to send. |
Dictionary<System.String, System.Object> | bindings | Bindings for parameters used in the requestScript. |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<ResultSet<T>> | A ResultSet<T> containing the data and status attributes returned from the server. |
Type Parameters
Name | Description |
---|---|
T | The type of the expected results. |
Exceptions
Type | Condition |
---|---|
ResponseException | Thrown when a response is received from Gremlin Server that indicates that an error occurred. |
SubmitWithSingleResultAsync<T>(IGremlinClient, RequestMessage, CancellationToken)
Submits a request message as an asynchronous operation where only a single result gets returned.
Declaration
public static async Task<T> SubmitWithSingleResultAsync<T>(this IGremlinClient gremlinClient, RequestMessage requestMessage, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
IGremlinClient | gremlinClient | The IGremlinClient that submits the request. |
RequestMessage | requestMessage | The |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> | A single result received from the Gremlin Server. |
Type Parameters
Name | Description |
---|---|
T | The type of the expected result. |
Remarks
If multiple results are received from Gremlin Server, then only the first gets returned. Use SubmitAsync<T>(IGremlinClient, String, Dictionary<String, Object>, CancellationToken) instead when you expect a collection of results.
Exceptions
Type | Condition |
---|---|
ResponseException | Thrown when a response is received from Gremlin Server that indicates that an error occurred. |
SubmitWithSingleResultAsync<T>(IGremlinClient, String, Dictionary<String, Object>, CancellationToken)
Submits a request message that consists of a script with bindings as an asynchronous operation where only a single result gets returned.
Declaration
public static async Task<T> SubmitWithSingleResultAsync<T>(this IGremlinClient gremlinClient, string requestScript, Dictionary<string, object> bindings = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
IGremlinClient | gremlinClient | The IGremlinClient that submits the request. |
System.String | requestScript | The Gremlin request script to send. |
Dictionary<System.String, System.Object> | bindings | Bindings for parameters used in the requestScript. |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> | A single result received from the Gremlin Server. |
Type Parameters
Name | Description |
---|---|
T | The type of the expected result. |
Remarks
If multiple results are received from Gremlin Server, then only the first gets returned. Use SubmitAsync<T>(IGremlinClient, String, Dictionary<String, Object>, CancellationToken) instead when you expect a collection of results.
Exceptions
Type | Condition |
---|---|
ResponseException | Thrown when a response is received from Gremlin Server that indicates that an error occurred. |