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".

Method Details

Hide inherited methods

__construct() public method

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

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

            
getAdapter() public method

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

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

            
getChannel() public method

public getChannel( ): string

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

            
listen() public method

public listen( ): void

                public function listen(): void
{
}

            
push() public method

public push( Yiisoft\Queue\Message\MessageInterface $message, string|array|callable|Yiisoft\Queue\Middleware\Push\MiddlewarePushInterface $middlewareDefinitions ): Yiisoft\Queue\Message\MessageInterface
$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 run( integer $max 0 ): integer
$max integer

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

            
status() public method

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

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

            
withAdapter() public method

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

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