0 follower

Final Class Yiisoft\Queue\Stubs\StubQueue

InheritanceYiisoft\Queue\Stubs\StubQueue
ImplementsYiisoft\Queue\QueueInterface

Stub queue that does nothing. Job status is always "done".

Constants

Hide inherited constants

Constant Value Description Defined By
DEFAULT_CHANNEL 'yii-queue' Yiisoft\Queue\QueueInterface

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( Yiisoft\Queue\Adapter\AdapterInterface|null $adapter null )
$adapter Yiisoft\Queue\Adapter\AdapterInterface|null

                public function __construct(private ?AdapterInterface $adapter = null)
{
}

            
getAdapter() public method

public Yiisoft\Queue\Adapter\AdapterInterface|null getAdapter ( )

                public function getAdapter(): ?AdapterInterface
{
    return $this->adapter;
}

            
getChannel() public method

public string getChannel ( )

                public function getChannel(): string
{
    if ($this->adapter === null) {
        throw new LogicException('Adapter is not set.');
    }
    return $this->adapter->getChannel();
}

            
listen() public method

public void listen ( )

                public function listen(): void
{
}

            
push() public method

public Yiisoft\Queue\Message\MessageInterface push ( Yiisoft\Queue\Message\MessageInterface $message, string|array|callable|Yiisoft\Queue\Middleware\Push\MiddlewarePushInterface $middlewareDefinitions )
$message Yiisoft\Queue\Message\MessageInterface
$middlewareDefinitions string|array|callable|Yiisoft\Queue\Middleware\Push\MiddlewarePushInterface

                public function push(
    MessageInterface $message,
    string|array|callable|MiddlewarePushInterface ...$middlewareDefinitions
): MessageInterface {
    return $message;
}

            
run() public method

public integer run ( integer $max 0 )
$max integer

                public function run(int $max = 0): int
{
    return 0;
}

            
status() public method

public \Yiisoft\Queue\JobStatus status ( integer|string $id )
$id integer|string

                public function status(int|string $id): JobStatus
{
    return JobStatus::DONE;
}

            
withAdapter() public method

public Yiisoft\Queue\Stubs\StubQueue withAdapter ( Yiisoft\Queue\Adapter\AdapterInterface $adapter )
$adapter Yiisoft\Queue\Adapter\AdapterInterface

                public function withAdapter(AdapterInterface $adapter): static
{
    $new = clone $this;
    $new->adapter = $adapter;
    return $new;
}