Class GremlinClientExtensions
Provides extension methods for the IGremlinClient interface.
Inherited Members
Namespace: Gremlin.Net.Driver
Assembly: Gremlin.Net.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 Task SubmitAsync(this IGremlinClient gremlinClient, RequestMessage requestMessage, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IGremlinClient | gremlinClient | The IGremlinClient that submits the request. |
| RequestMessage | requestMessage | The RequestMessage to send. |
| CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
| Type | Description |
|---|---|
| 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 Task SubmitAsync(this IGremlinClient gremlinClient, string requestScript, Dictionary<string, object>? bindings = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IGremlinClient | gremlinClient | The IGremlinClient that submits the request. |
| string | requestScript | The Gremlin request script to send. |
| Dictionary<string, 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 |
|---|---|
| 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 Task<ResultSet<T>> SubmitAsync<T>(this IGremlinClient gremlinClient, string requestScript, Dictionary<string, object>? bindings = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IGremlinClient | gremlinClient | The IGremlinClient that submits the request. |
| string | requestScript | The Gremlin request script to send. |
| Dictionary<string, 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 |
|---|---|
| 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 Task<T?> SubmitWithSingleResultAsync<T>(this IGremlinClient gremlinClient, RequestMessage requestMessage, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IGremlinClient | gremlinClient | The IGremlinClient that submits the request. |
| RequestMessage | requestMessage | The RequestMessage to send. |
| CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
| Type | Description |
|---|---|
| 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 Task<T?> SubmitWithSingleResultAsync<T>(this IGremlinClient gremlinClient, string requestScript, Dictionary<string, object>? bindings = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IGremlinClient | gremlinClient | The IGremlinClient that submits the request. |
| string | requestScript | The Gremlin request script to send. |
| Dictionary<string, 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 |
|---|---|
| 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. |