Release to queue

@param $connection
420131
private function releaseToQueue(ConnectionInterface $connection)
    {
        if ($this->queue->count() < $this->poolConfig->getMaxActive()) {
            $this->queue->push($connection);
        }
    }
327397
protected function getQueue($connection)
	{
		if (is_null($connection))
		{
			$connection = $this->flyphp['config']['queue.default'];
		}

		$queue = $this->flyphp['config']->get("queue.connections.{$connection}.queue", 'default');

		return $this->input->getOption('queue') ?: $queue;
	}
1095312
public function release($delay = 0)
    {
        parent::release($delay);

        $this->sqs->changeMessageVisibility([
            'QueueUrl' => $this->queue,
            'ReceiptHandle' => $this->job['ReceiptHandle'],
            'VisibilityTimeout' => $delay,
        ]);
    }
216702
public function client($connection = null)
    {
        $connection = $connection ?: $this->setting('connection');
        return $this->git->connection($connection);
    }
913486
protected function getNextJob( $connection, $queue )
	{
		if ( is_null( $queue ) )
			return $connection->pop();

		foreach ( explode( ',', $queue ) as $queue )
			if ( !is_null( $job = $connection->pop( $queue ) ) )
				return $job;

		return null;
	}
904913
protected function readyToRevive(Connection $connection)
    {
        $timeout = min(
            $this->pingTimeout * pow(2, $connection->getPingFailures()),
            $this->maxPingTimeout
        );

        if ($connection->getLastPing() + $timeout < time()) {
            return true;
        } else {
            return false;
        }
    }
877649
protected function runWorker($connection, $queue)
    {
        foreach (explode(',', $queue) as $tube) {
            $this->worker->eyeQueues[] = Queue::firstOrCreate(['connection' => $connection,
                                                               'tube' => $tube,
                                                               'driver' => $this->getDriverName($connection),
                                                               'healthy' => 1]);
        }

        return parent::runWorker($connection, $queue);
    }
301592
def release(self, connection: Connection, reuse: bool=True):
        '''
        '''
        yield from self._condition.acquire()
        self.busy.remove(connection)

        if reuse:
            self.ready.add(connection)

        self._condition.notify()
        self._condition.release()
1230551
def release(self, connection):
        ""
        # Make sure we haven't changed process.
        self._checkpid()
        if connection.pid != self.pid:
            return

        # Put the connection back into the pool.
        try:
            self.pool.put_nowait(connection)
        except Full:
            # perhaps the pool has been reset() after a fork? regardless,
            # we don't want this connection
            pass
315608
public function released($connection, $queue, JobPayload $payload)
    {
        $this->connection()->hmset(
            $payload->id(), [
                'status' => 'pending',
                'payload' => $payload->value,
                'updated_at' => str_replace(',', '.', microtime(true)),
            ]
        );
    }
945010
protected function prepare(Connection $connection)
	{
		$connection->setFetchMode($this->app['config']['database.fetch']);

		if ($this->app->bound('events'))
		{
			$connection->setEventDispatcher($this->app['events']);
		}

		// Here we'll set a reconnector callback. This reconnector can be any callable
		// so we will set a Closure to reconnect from this manager with the name of
		// the connection, which will allow us to reconnect from the connections.
		$connection->setReconnector(function($connection)
		{
			$this->reconnect($connection->getName());
		});

		return $connection;
	}
798217
def release(self, connection: Connection):
        '''
        '''
        assert not self._closed

        key = connection.key
        host_pool = self._host_pools[key]

        _logger.debug('Check in %s', key)

        yield from host_pool.release(connection)

        force = self.count() > self._max_count
        yield from self.clean(force=force)
786552
def release(self, priority=None, delay=0):
        """"""
        if self.reserved:
            self.conn.release(self.jid, priority or self._priority(), delay)
            self.reserved = False
129859
public function release(
        Job $job,
        $priority = null,
        $delay = null
    )
    {
        $priority = $priority ?? PheanstalkInterface::DEFAULT_PRIORITY;
        $delay = $delay ?? PheanstalkInterface::DEFAULT_DELAY;

        return $this->client->release($job, $priority, $delay);
    }
443067
def release(self, conn):
        """"""
        self._pool_lock.acquire()
        self._pool.put(ConnectionWrapper(self._pool, conn))
        self._current_acquired -= 1
        self._pool_lock.release()
677532
public function makeProcess($connection, $queue, ListenerOptions $options)
    {
        $command = $this->createCommand(
            $connection,
            $queue,
            $options
        );

        // If the environment is set, we will append it to the command array so the
        // workers will run under the specified environment. Otherwise, they will
        // just run under the production environment which is not always right.
        if (isset($options->environment)) {
            $command = $this->addEnvironment($command, $options);
        }

        return new Process(
            $command,
            $this->commandPath,
            null,
            null,
            $options->timeout
        );
    }
465371
public function release( MW_DB_Connection_Interface $connection, $name = 'db' )
	{
		if( ( $connection instanceof MW_DB_Connection_PDO ) === false ) {
			throw new MW_DB_Exception( 'Connection object isn\'t of type PDO' );
		}

		$this->_connections[$name][] = $connection;
	}