public PooledConnection(IConnection conn, IConnectionReleaseManager releaseManager = null) : base(conn) { _releaseManager = releaseManager; // IdleTimer starts to count when the connection is put back to the pool. IdleTimer = new StopwatchBasedTimer(); // LifetimeTimer starts to count once the connection is created. LifetimeTimer = new StopwatchBasedTimer(); LifetimeTimer.Start(); }
public PooledConnection(IConnection conn, IConnectionReleaseManager releaseManager = null, IConnectionListener connMetricsListener = null) : base(conn) { _releaseManager = releaseManager; // IdleTimer starts to count when the connection is put back to the pool. IdleTimer = new StopwatchBasedTimer(); // LifetimeTimer starts to count once the connection is created. LifetimeTimer = new StopwatchBasedTimer(); LifetimeTimer.Start(); _connMetricsListener = connMetricsListener; if (_connMetricsListener != null) { _connEvent = new SimpleTimerEvent(); } }
public PooledConnection(IConnection conn, Action <IPooledConnection> releaseAction = null) : base(conn) { _releaseAction = releaseAction ?? (x => { }); IdleTimer = new StopwatchBasedTimer(); }