Tail the given log file for the connection.

@param string $path
@param string $connection

@return void
975581
protected function tailLogFile($path, $connection)
    {
        if (is_null($connection)) {
            $this->tailLocalLogs($path);
        } else {
            $this->tailRemoteLogs($path, $connection);
        }
    }
106073
public function onSlaveConnection(ConnectionInterface $connection)
    {
        $this->bindProcessMessage($connection);
        $connection->on('close', function () use ($connection) {
            $this->onSlaveClosed($connection);
        });
    }
588124
public function onGatewayClose($connection)
    {
        $addr = $connection->remoteAddress;
        unset($this->gatewayConnections[$addr], $this->_connectingGatewayAddresses[$addr]);
        if (isset($this->_gatewayAddresses[$addr]) && !isset($this->_waitingConnectGatewayAddresses[$addr])) {
            Timer::add(1, array($this, 'tryToConnectGateway'), array($addr), false);
            $this->_waitingConnectGatewayAddresses[$addr] = $addr;
        }
    }
420131
private function releaseToQueue(ConnectionInterface $connection)
    {
        if ($this->queue->count() < $this->poolConfig->getMaxActive()) {
            $this->queue->push($connection);
        }
    }
471003
public static final void rollback(final Connection connection) {
        try {
            connection.rollback();
        } catch (Exception e) {
            if (LOG.isWarnEnabled()) LOG.warn("Error rolling back Connection: " + connection, e);
        }
    }
1345059
public function close(?string $connection = null): void
	{
		$connection = $connection ?? $this->default;

		if(isset($this->connections[$connection]))
		{
			if(method_exists($this->connections[$connection], 'close'))
			{
				// Call close on the connection object in case there's a reference
				// to the connection that won't be garbage collected immediately

				$this->connections[$connection]->close();
			}

			unset($this->connections[$connection]);
		}
	}
1114447
protected function expandTreeAfterRgt(Connection $connection, $table, $rgt, $width)
    {
        $query = (new Query())
            ->update()
            ->table($table)
            ->values([
                '__lft' => 'CASE WHEN __lft>:rgt THEN __lft + (:width + 1) ELSE __lft END',
                '__rgt' => 'CASE WHEN __rgt>:rgt THEN __rgt + (:width + 1) ELSE __rgt END',
            ])
            ->where('__lft>:rgt OR __rgt>:rgt')
            ->order('__lft DESC')
            ->params([':rgt' => $rgt, ':width' => $width]);
        $connection->execute($query);
    }
476982
public function removeConnection(Connection $connection): void
    {
        $socket = $connection->getSocket();

        if ($socket->getResource()) {
            $index = $socket->getResourceId();
        } else {
            $index = array_search($connection, $this->connections);
        }

        if (!$index) {
            $this->logger->warning('Could not remove connection: not found');
        }

        unset($this->connections[$index]);
        unset($this->resources[$index]);

        $this->server->notify(
            Server::EVENT_SOCKET_DISCONNECT,
            [$connection->getSocket(), $connection]
        );
    }
79682
public function log($connection, $queue, $payload)
    {
        $failed_at = date(DateTime::MYSQL_DATETIME);
        $this->getDb()->insertAsDict($this->table, compact('connection', 'queue', 'payload', 'failed_at'));
    }
1179800
protected function addForwardTrigger(Connection $connection, string $name, string $table, string $time, string $event, string $statements): void
    {
        $this->addTrigger($connection, $name, $table, $time, $event, $statements, '');
    }
648231
private function logQuery($path, $method, $data, array $query, $start, $engineMS = 0, $itemCount = 0)
    {
        if (!$this->_logger or !$this->_logger instanceof ElasticaLogger) {
            return;
        }

        $time = microtime(true) - $start;
        $connection = $this->getLastRequest()->getConnection();

        $connection_array = array(
            'host' => $connection->getHost(),
            'port' => $connection->getPort(),
            'transport' => $connection->getTransport(),
            'headers' => $connection->hasConfig('headers') ? $connection->getConfig('headers') : array(),
        );

        $this->_logger->logQuery($path, $method, $data, $time, $connection_array, $query, $engineMS, $itemCount);
    }
886958
private function removeMigration(Connection $connection, int $index): void
    {
        $connection->delete(static::MIGRATIONS_TABLE, [static::MIGRATIONS_COLUMN_ID => $index]);
    }
323885
public function commit(ConnectionInterface $connection)
    {
        // We decrement the transaction level and prevent events to be dispatched
        // while comitting nested transactions, so no transient state is saved.
        // Only dispatch events right after the outer transaction commits.
        $this->transactionLevel--;
        if (! $this->isPrepared($connection) || $this->transactionLevel > 0) {
            return;
        }

        $this->dispatchPendingEvents($connection);
    }
788113
protected function expandTreeBeforeLft(Connection $connection, $table, $lft, $width)
    {
        $query = (new Query())
            ->update()
            ->table($table)
            ->values([
                '__lft' => 'CASE WHEN __lft>=:lft THEN __lft + (:width + 1) ELSE __lft END',
                '__rgt' => 'CASE WHEN __rgt>=:lft THEN __rgt + (:width + 1) ELSE  __rgt END',
            ])
            ->where('__lft>=:lft OR __rgt>=:lft')
            ->order('__lft DESC')
            ->params([':lft' => $lft, ':width' => $width]);
        $connection->execute($query);
    }
363602
protected function checkConnectionsPerIp($connection)
    {
        $ip = $connection->getIp();

        if (!$ip) {
            $this->logger->warning('Cannot check connections per IP');
            return;
        }

        if (!isset($this->ips[$ip])) {
            $this->ips[$ip] = 1;
        } else {
            $this->ips[$ip] = min(
                $this->options['connections_per_ip'],
                $this->ips[$ip] + 1
            );
        }

        if ($this->ips[$ip] > $this->options['connections_per_ip']) {
            $this->limit($connection, 'Connections per IP');
        }
    }
839719
public function log($connection, $queue, $payload, $exception)
    {
        $failed_at = Date::now();

        $exception = (string) $exception;

        return $this->getTable()->insertGetId(compact(
            'connection', 'queue', 'payload', 'exception', 'failed_at'
        ));
    }
1281556
public static function onClose($connection)
    {
        $connection->handshakeStep               = null;
        $connection->websocketCurrentFrameLength = 0;
        $connection->tmpWebsocketData            = '';
        $connection->websocketDataBuffer         = '';
        if (!empty($connection->websocketPingTimer)) {
            Timer::del($connection->websocketPingTimer);
            $connection->websocketPingTimer = null;
        }
    }