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
Constants
| Constant | Value | Description | Defined By |
|---|---|---|---|
| DEFAULT_CHANNEL | 'yii-queue' | Yiisoft\Queue\QueueInterface |
Method Details
| public mixed __construct ( Yiisoft\Queue\Adapter\AdapterInterface|null $adapter = null ) | ||
| $adapter | Yiisoft\Queue\Adapter\AdapterInterface|null | |
public function __construct(private ?AdapterInterface $adapter = null)
{
}
| public Yiisoft\Queue\Adapter\AdapterInterface|null getAdapter ( ) |
public function getAdapter(): ?AdapterInterface
{
return $this->adapter;
}
| public string getChannel ( ) |
public function getChannel(): string
{
if ($this->adapter === null) {
throw new LogicException('Adapter is not set.');
}
return $this->adapter->getChannel();
}
| 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;
}
| public integer run ( integer $max = 0 ) | ||
| $max | integer | |
public function run(int $max = 0): int
{
return 0;
}
| public \Yiisoft\Queue\JobStatus status ( integer|string $id ) | ||
| $id | integer|string | |
public function status(int|string $id): JobStatus
{
return JobStatus::DONE;
}
| 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;
}
Signup or Login in order to comment.