/// <summary> /// Closes connections to every Bob node in cluster /// </summary> /// <param name="mode">Mode that contols close error handling</param> /// <exception cref="BobOperationException">Error during connection shutdown</exception> public void Close(BobClusterOpenCloseMode mode) { for (int i = 0; i < _clients.Length; i++) { try { _clients[i].Close(); } catch (BobOperationException) { if (mode == BobClusterOpenCloseMode.ThrowOnFirstError) { throw; } } } }
/// <summary> /// Closes connections to every Bob node in cluster /// </summary> /// <param name="mode">Mode that contols close error handling</param> /// <returns>Task to await</returns> /// <exception cref="BobOperationException">Error during connection shutdown</exception> public async Task CloseAsync(BobClusterOpenCloseMode mode) { for (int i = 0; i < _clients.Length; i++) { try { await _clients[i].CloseAsync().ConfigureAwait(false); } catch (BobOperationException) { if (mode == BobClusterOpenCloseMode.ThrowOnFirstError) { throw; } } } }
/// <summary> /// Closes connections to every Bob node in cluster /// </summary> /// <param name="mode">Mode that contols close error handling</param> /// <returns>Task to await</returns> /// <exception cref="BobOperationException">Error during connection shutdown</exception> public Task CloseAsync(BobClusterOpenCloseMode mode) { return(_innerCluster.CloseAsync(mode)); }
/// <summary> /// Closes connections to every Bob node in cluster /// </summary> /// <param name="mode">Mode that contols close error handling</param> /// <exception cref="BobOperationException">Error during connection shutdown</exception> public void Close(BobClusterOpenCloseMode mode) { _innerCluster.Close(mode); }
/// <summary> /// Explicitly opens connection to every Bob node in cluster /// </summary> /// <param name="mode">Mode that contols open error handling</param> /// <exception cref="BobOperationException">Connection was not opened</exception> /// <exception cref="TimeoutException">Specified timeout reached</exception> /// <exception cref="ObjectDisposedException">Client was disposed</exception> public void Open(BobClusterOpenCloseMode mode) { _innerCluster.Open(mode); }