/** * @inheritdoc * @throws InvalidConfigException */ public function init() { parent::init(); if (strlen($this->id) !== 1) { throw new InvalidConfigException(Yii::t('app', 'Queue id must be exactly a one character.')); } }
/** * @inheritdoc * @throws NotSupportedException */ public function init() { parent::init(); if ($this->blocking) { throw new NotSupportedException(Yii::t('app', 'DbQueue does not support blocking.')); } }
/** * @inheritdoc * @throws InvalidConfigException */ public function init() { parent::init(); if (is_string($this->redis)) { $this->redis = Yii::$app->get($this->redis); } elseif (is_array($this->redis)) { } if (!$this->redis instanceof yii\redis\Connection) { throw new InvalidConfigException('The redis property must contain a name or a valid yii\\redis\\Connection component.'); } }
/** * @inheritdoc * @throws NotSupportedException */ public function init() { parent::init(); if ($this->blocking) { throw new NotSupportedException(Yii::t('app', 'MailQueue does not support blocking.')); } $this->subscriptionQueue = Instance::ensure($this->subscriptionQueue, 'nineinchnick\\nfy\\components\\QueueInterface'); $this->mailer = Instance::ensure($this->mailer, 'yii\\mail\\MailerInterface'); if (!is_callable($this->recipientCallback)) { throw new InvalidConfigException(Yii::t('app', 'MailQueue requires a valid callback for recipientCallback.')); } if ($this->composeCallback === null) { $this->composeCallback = [$this, 'createMessage']; } }