Class GremlinClient
Provides a mechanism for submitting Gremlin requests to one Gremlin Server.
Inheritance
Inherited Members
Namespace: Gremlin.Net.Driver
Assembly: cs.temp.dll.dll
Syntax
public class GremlinClient : IGremlinClient, IDisposable
Constructors
GremlinClient(GremlinServer, GraphSONReader, GraphSONWriter, String, Action<ClientWebSocketOptions>)
Initializes a new instance of the GremlinClient class for the specified Gremlin Server.
Declaration
public GremlinClient(GremlinServer gremlinServer, GraphSONReader graphSONReader = null, GraphSONWriter graphSONWriter = null, string mimeType = null, Action<ClientWebSocketOptions> webSocketConfiguration = null)
Parameters
Type | Name | Description |
---|---|---|
GremlinServer | gremlinServer | The GremlinServer the requests should be sent to. |
GraphSONReader | graphSONReader | A GraphSONReader instance to read received GraphSON data. |
GraphSONWriter | graphSONWriter | a GraphSONWriter instance to write GraphSON data. |
System.String | mimeType | The GraphSON version mime type, defaults to latest supported by the server. |
System.Action<ClientWebSocketOptions> | webSocketConfiguration | A delegate that will be invoked with the |
Fields
DefaultMimeType
Defines the default mime type to use.
Declaration
public const string DefaultMimeType = "application/vnd.gremlin-v3.0+json"
Field Value
Type | Description |
---|---|
System.String |
GraphSON2MimeType
The GraphSON2 mime type to use.
Declaration
public const string GraphSON2MimeType = "application/vnd.gremlin-v2.0+json"
Field Value
Type | Description |
---|---|
System.String |
Properties
NrConnections
Gets the number of open connections.
Declaration
public int NrConnections { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Releases the resources used by the GremlinClient instance.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Specifies whether managed resources should be released. |
SubmitAsync<T>(RequestMessage)
Submits a request message as an asynchronous operation.
Declaration
public Task<IReadOnlyCollection<T>> SubmitAsync<T>(RequestMessage requestMessage)
Parameters
Type | Name | Description |
---|---|---|
RequestMessage | requestMessage | The RequestMessage to send. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<T>> | A collection of the data 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. |