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, ConnectionPoolSettings, Action<ClientWebSocketOptions>, String)
Initializes a new instance of the GremlinClient class for the specified Gremlin Server.
Declaration
[Obsolete("This constructor is obsolete. Use the constructor that takes a IMessageSerializer instead.")]
public GremlinClient(GremlinServer gremlinServer, GraphSONReader graphSONReader, GraphSONWriter graphSONWriter, ConnectionPoolSettings connectionPoolSettings = null, Action<ClientWebSocketOptions> webSocketConfiguration = null, string sessionId = null)
Parameters
Type | Name | Description |
---|---|---|
GremlinServer | gremlinServer | The GremlinServer the requests should be sent to. |
GraphSONReader | graphSONReader | A |
GraphSONWriter | graphSONWriter | a |
ConnectionPoolSettings | connectionPoolSettings | The ConnectionPoolSettings for the connection pool. |
System.Action<ClientWebSocketOptions> | webSocketConfiguration | A delegate that will be invoked with the |
System.String | sessionId | The session Id if Gremlin Client in session mode, defaults to null as session-less Client. |
GremlinClient(GremlinServer, IMessageSerializer, ConnectionPoolSettings, Action<ClientWebSocketOptions>, String, Boolean, Nullable<ILoggerFactory>)
Initializes a new instance of the GremlinClient class for the specified Gremlin Server.
Declaration
public GremlinClient(GremlinServer gremlinServer, IMessageSerializer messageSerializer = null, ConnectionPoolSettings connectionPoolSettings = null, Action<ClientWebSocketOptions> webSocketConfiguration = null, string sessionId = null, bool disableCompression = false, ILoggerFactory? loggerFactory = default(ILoggerFactory? ))
Parameters
Type | Name | Description |
---|---|---|
GremlinServer | gremlinServer | The GremlinServer the requests should be sent to. |
IMessageSerializer | messageSerializer | A IMessageSerializer instance to serialize messages sent to and received from the server. |
ConnectionPoolSettings | connectionPoolSettings | The ConnectionPoolSettings for the connection pool. |
System.Action<ClientWebSocketOptions> | webSocketConfiguration | A delegate that will be invoked with the |
System.String | sessionId | The session Id if Gremlin Client in session mode, defaults to null as session-less Client. |
System.Boolean | disableCompression | Whether to disable compression. Compression is only supported since .NET 6. There it is also enabled by default. Note that compression might make your application susceptible to attacks like CRIME/BREACH. Compression should therefore be turned off if your application sends sensitive data to the server as well as data that could potentially be controlled by an untrusted user. |
System.Nullable<ILoggerFactory> | loggerFactory | A factory to create loggers. If not provided, then nothing will be logged. |
GremlinClient(GremlinServer, Nullable<GraphSONReader>, Nullable<GraphSONWriter>, String, ConnectionPoolSettings, Action<ClientWebSocketOptions>, String)
Initializes a new instance of the GremlinClient class for the specified Gremlin Server.
Declaration
[Obsolete("This constructor is obsolete. Use the constructor that takes a IMessageSerializer instead.")]
public GremlinClient(GremlinServer gremlinServer, GraphSONReader? graphSONReader, GraphSONWriter? graphSONWriter, string mimeType, ConnectionPoolSettings connectionPoolSettings = null, Action<ClientWebSocketOptions> webSocketConfiguration = null, string sessionId = null)
Parameters
Type | Name | Description |
---|---|---|
GremlinServer | gremlinServer | The GremlinServer the requests should be sent to. |
System.Nullable<GraphSONReader> | graphSONReader | A |
System.Nullable<GraphSONWriter> | graphSONWriter | a |
System.String | mimeType | The GraphSON version mime type, defaults to latest supported by the server. |
ConnectionPoolSettings | connectionPoolSettings | The ConnectionPoolSettings for the connection pool. |
System.Action<ClientWebSocketOptions> | webSocketConfiguration | A delegate that will be invoked with the |
System.String | sessionId | The session Id if Gremlin Client in session mode, defaults to null as session-less Client. |
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, CancellationToken)
Submits a request message as an asynchronous operation.
Declaration
public async Task<ResultSet<T>> SubmitAsync<T>(RequestMessage requestMessage, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
RequestMessage | requestMessage | The |
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. |