/// <summary> /// Adds a new channel to the pool. A new <see cref="DgraphConnection"/> will be created. /// </summary> /// <param name="channel">The channel to add.</param> /// <returns></returns> public DgraphConnectionPool Add(Channel channel) { var conn = new DgraphConnection(channel); _connections.Add(conn); return(this); }
/// <summary> /// Add a new connection to the pool. /// </summary> /// <param name="connection">The connection to add.</param> /// <returns></returns> public DgraphConnectionPool Add(DgraphConnection connection) { _connections.Add(connection); return(this); }
/// <summary> /// Creates a new DgraphNet client for interacting with a Dgraph store. /// <para/>A single client is thread safe. /// </summary> /// <param name="connection">A Dgraph connection.</param> /// <param name="deadlineSecs">Deadline specified in secs, after which the client will timeout.</param> public DgraphNetClient(DgraphConnection connection, int deadlineSecs) : this(new DgraphConnectionPool(new[] { connection }), deadlineSecs) { }
/// <summary> /// Creates a new DgraphNet client for interacting with a Dgraph store. /// <para/>A single client is thread safe. /// </summary> /// <param name="connection">A Dgraph connection.</param> public DgraphNetClient(DgraphConnection connection) : this(new DgraphConnectionPool(new[] { connection })) { }