code: func (p *Pool) pingAndPurgeIfNeeded(other *Pool) error {
  	ping := redisPool.Get()
  	pong := redis.PubSubConn{redisPool.Get()}
  	// Listen for pongs by subscribing to the other pool's pong key
  	pong.Subscribe(other.pongKey())
  	// Ping the other pool by publishing to its ping key
  	ping.Do("PUBLISH", other.pingKey(), 1)
  	// Use a select statement to either receive the pong or timeout
  	pongChan := make(chan interface{})
  	errChan := make(chan error)
  	go func() {
  		defer func() {
  			pong.Close()
  			ping.Close()
  		}()
  		select {
  		case <-p.exit:
  			return
  		default:
  		}
  		for {
  			reply := pong.Receive()
  			switch reply.(type) {
  			case redis.Message:
  				// The pong was received
  				pongChan <- reply
  				return
  			case error:
  				// There was some unexpected error
  				err := reply.(error)
  				errChan <- err
  				return
  			}
  		}
  	}()
  	timeout := time.After(p.config.StaleTimeout)
  	select {
  	case <-pongChan:
  		// The other pool responded with a pong
  		return nil
  	case err := <-errChan:
  		// Received an error from the pubsub conn
  		return err
  	case <-timeout:
  		// The pool is considered stale and should be purged
  		t := newTransaction()
  		other.RLock()
  		otherId := other.id
  		other.RUnlock()
  		t.purgeStalePool(otherId)
  		if err := t.exec(); err != nil {
  			return err
  		}
  	}
  	return nil
  }
docs: // pingAndPurgeIfNeeded pings other by publishing to others ping key. If it
  // does not receive a pong reply within some amount of time, it will
  // assume the pool is stale and purge it.