Пример #1
0
 /// <summary>
 /// Creates a new DgraphNet client for interacting with a Dgraph store.
 /// <para/>A single client is thread safe.
 /// </summary>
 /// <param name="pool">A Dgraph connection pool. Can contain connections to multiple servers in a cluster.</param>
 public DgraphNetClient(DgraphConnectionPool pool) : this()
 {
     if (pool.Connections.Count == 0)
     {
         throw new InvalidOperationException("A connection pool must have at least one connection.");
     }
     _pool = pool;
 }
Пример #2
0
 /// <summary>
 /// Creates a new DgraphNet client for interacting with a Dgraph store, with the the specified deadline.
 /// <para>A single client is thread safe.</para>
 /// </summary>
 /// <param name="pool">A Dgraph connection pool. Can contain connections to multiple servers in a cluster.</param>
 /// <param name="deadlineSecs">Deadline specified in secs, after which the client will timeout.</param>
 public DgraphNetClient(DgraphConnectionPool pool, int deadlineSecs)
     : this(pool)
 {
     _deadlineSecs = deadlineSecs;
 }