Get original connection

@param bool $isChannel

@return ConnectionInterface
18370
private function getOriginalConnection(bool $isChannel = true): ConnectionInterface
    {
        if ($isChannel) {
            return $this->channel->pop();
        }

        return $this->queue->shift();
    }
802432
public function getConnection($serviceName)
    {
        if (empty($this->connectionPool[$serviceName])) {
            $this->initConnection($serviceName);
        }

        return $this->connectionPool[$serviceName];
    }
1139612
public function getChannel(string $channel): Channel
    {
        if (!$this->channelExists($channel)) {
            throw new OutOfRangeException("The channel[{$channel}] not found");
        }

        return $this->channels[$channel];
    }
516486
public static function getLogger($channel)
    {
        $callback = self::$callback;
        if (null === $callback) {
            return new NullLogger();
        }

        $logger = $callback($channel);
        if ($logger instanceof LoggerInterface) {
            return $logger;
        }

        throw new RuntimeException('Callback did not return an instance of \Psr\Log\LoggerInterface!');
    }
534041
public function fetch($channel = 'default')
    {
        $items = $this->getFromCache($channel);
        if (!$items) {
            $items = parent::fetch($channel);
            $this->setToCache($channel, $items);
        }

        return $items;
    }
929026
public static function get(string $channel, array $handlers)
    {
        $logger = new static();
        return $logger->setUid(static::generateUid())
            ->setHandlers($handlers)
            ->setChannel($channel);
    }
544242
public function &loadConnection($connectionOffset)
    {
        $loadConnection[ $connectionOffset ] = false;

        if ( ! $this->exists($connectionOffset) and $this->config->offsetExists($connectionOffset)) {

            $connectionConfig = $this->config->offsetGet($connectionOffset);

            if (is_array($connectionConfig)) {
                new DataStructures\Config($this->config[ $connectionOffset ]);
            }

            $this->createConnection($connectionOffset, $connectionConfig);

            return $this->getObject($connectionOffset);

        } elseif ($this->exists($connectionOffset)) {
            return $this->getObject($connectionOffset);
        }

        return $loadConnection;
    }
1115137
public function resetChannel($channel)
    {
        $op = $this->sendResetChannelOperation($channel);

        // waiting for reset operation finishes
        $op = $this->awaitOperation($op);

        // true if succeeded
        return $op->getState() == OperationState::Succeeded;
    }
478325
protected function getConnectionInstance($datasource)
    {
        $buildConnection = $this->getConnection($datasource);

        $dsn = str_replace("@DB@", $datasource, $buildConnection['dsn']);

        // Set user + password to null if they are empty strings or missing
        $username = isset($buildConnection['user']) && $buildConnection['user'] ? $buildConnection['user'] : null;
        $password = isset($buildConnection['password']) && $buildConnection['password'] ? $buildConnection['password'] : null;

        $con = ConnectionFactory::create(['dsn' => $dsn, 'user' => $username, 'password' => $password], AdapterFactory::create($buildConnection['adapter']));

        return $con;
    }
441593
public function connect($retry = false) {
		return $this->_backoff(
			function() { return $this->_connection->connect(); },
			$retry ? false : 1
		);
	}
353929
public function getChannel($channel)
    {
        $channelId = Utilities::getEntityId(
            $channel,
            'WindowsAzure\MediaServices\Models\Channel'
        );

        return Channel::createFromOptions($this->_getEntity("Channels('{$channelId}')"));
    }
220170
public function subscriberByChannel(string $channel): ?Subscriber
    {
        $key = self::SUBSCRIBER_KEY.".{$channel}";

        return $this->cache->get($key);
    }
43789
public function logger( $channel ) {

		$channel = (string) $channel;
		if ( ! $this->has_channel( $channel ) ) {
			throw InvalidChannelNameException::for_unregistered_channel( $channel );
		}

		if ( ! array_key_exists( $channel, $this->loggers ) ) {
			$this->loggers[ $channel ] = new Logger( $channel );
		}

		if ( ! in_array( $channel, $this->channels_initialized, TRUE ) ) {
			$this->channels_initialized[] = $channel;

			return $this->initialize_logger( $this->loggers[ $channel ] );
		}

		return $this->loggers[ $channel ];
	}
1172942
public function channel($channel = null)
    {
        // If the given driver has not been created before, we will create the instances
        // here and cache it so we can return it next time very quickly. If there is
        // already a driver created by this name, we'll just return that instance.
        if (!$this->hasChannel($channel)) {
            $this->addChannel($channel, $this->createChannel($channel));
        }

        return $this->getChannel($channel);
    }
364007
public function getConnection()
    {
        if ($this->connection instanceof ConnectionInterface === FALSE)
        {
            $this->connection = Propel::getConnection();
        }

        return $this->connection;
    }
287866
public function getChannel()
    {
        @trigger_error(sprintf('The method %s is deprecated since version 3.3 and will be removed in 4.0. Use %s::getContext() instead.', __METHOD__, __CLASS__), E_USER_DEPRECATED);

        if (!$this->channel) {
            if (!$this->context instanceof \Enqueue\AmqpLib\AmqpContext) {
                throw new \LogicException('The BC layer works only if enqueue/amqp-lib lib is being used.');
            }

            // load context
            $this->getContext();

            /** @var \Enqueue\AmqpLib\AmqpContext $context */
            $context = $this->getContext();

            $this->channel = $context->getLibChannel();
            $this->connection = $this->channel->getConnection();
        }

        return $this->channel;
    }
32035
public function getConnection()
    {
        if ($this->connection) {
            return $this->connection;
        }

        return $this->connection = new SFTP($this->host, $this->port, $this->timeout);
    }