Final Class Yiisoft\Queue\Stubs\StubQueue
| Inheritance | Yiisoft\Queue\Stubs\StubQueue |
|---|---|
| Implements | Yiisoft\Queue\QueueInterface |
Stub queue that does nothing. Job status is always "done".
Public Methods
Method Details
| public __construct( Yiisoft\Queue\Adapter\AdapterInterface|null $adapter = null ): mixed | ||
| $adapter | Yiisoft\Queue\Adapter\AdapterInterface|null | |
public function __construct(private ?AdapterInterface $adapter = null)
{
}
| public getAdapter( ): Yiisoft\Queue\Adapter\AdapterInterface|null |
public function getAdapter(): ?AdapterInterface
{
return $this->adapter;
}
| public getChannel( ): string |
public function getChannel(): string
{
if ($this->adapter === null) {
throw new LogicException('Adapter is not set.');
}
return $this->adapter->getChannel();
}
| 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;
}
| public run( integer $max = 0 ): integer | ||
| $max | integer | |
public function run(int $max = 0): int
{
return 0;
}
| public status( integer|string $id ): \Yiisoft\Queue\JobStatus | ||
| $id | integer|string | |
public function status(int|string $id): JobStatus
{
return JobStatus::DONE;
}
| 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;
}
Signup or Login in order to comment.