// public methods public IConnectionHandle AcquireConnection(CancellationToken cancellationToken) { ThrowIfNotOpen(); var helper = new AcquireConnectionHelper(this); try { helper.CheckingOutConnection(); var enteredPool = _poolQueue.Wait(_settings.WaitQueueTimeout, cancellationToken); return(helper.EnteredPool(enteredPool)); } catch (Exception ex) { helper.HandleException(ex); throw; } finally { helper.Finally(); } }
public async Task <IConnectionHandle> AcquireConnectionAsync(CancellationToken cancellationToken) { ThrowIfNotOpen(); var helper = new AcquireConnectionHelper(this); try { helper.CheckingOutConnection(); var enteredPool = await _poolQueue.WaitAsync(_settings.WaitQueueTimeout, cancellationToken).ConfigureAwait(false); return(helper.EnteredPool(enteredPool)); } catch (Exception ex) { helper.HandleException(ex); throw; } finally { helper.Finally(); } }
public async Task<IConnectionHandle> AcquireConnectionAsync(CancellationToken cancellationToken) { ThrowIfNotOpen(); var helper = new AcquireConnectionHelper(this); try { helper.CheckingOutConnection(); var enteredPool = await _poolQueue.WaitAsync(_settings.WaitQueueTimeout, cancellationToken).ConfigureAwait(false); return helper.EnteredPool(enteredPool); } catch (Exception ex) { helper.HandleException(ex); throw; } finally { helper.Finally(); } }
// public methods public IConnectionHandle AcquireConnection(CancellationToken cancellationToken) { ThrowIfNotOpen(); var helper = new AcquireConnectionHelper(this); try { helper.CheckingOutConnection(); var enteredPool = _poolQueue.Wait(_settings.WaitQueueTimeout, cancellationToken); return helper.EnteredPool(enteredPool); } catch (Exception ex) { helper.HandleException(ex); throw; } finally { helper.Finally(); } }