/** * Get unchecked subscribers by state * * @param string $state subscriber status * @return array */ public function getUncheckedSubscribers($state) { // get unchecked subscribers $key = md5(__FUNCTION__ . $state); $subscribers = Cache::exists($key) ? Cache::fetch($key) : $this->storageInstance->getSubscribers($state, 0); Cache::store($key, $subscribers); return $this->arrayPartition($subscribers, $this->cpuCoreCount()); }
/** * Testing for connect to DB Storage * * @param array $config * @throws \RuntimeException * @return boolean */ public function isStorageConnectSuccess(array $config) { $Storage = "\\Deliveries\\Adapter\\Storage\\" . $config["adapter"]; if (true === class_exists($Storage)) { $this->storageInstance = new $Storage(); if ($this->storageInstance->isSupport()) { return $this->storageInstance->connect($config); } throw new \RuntimeException($config["adapter"] . ' is not supported'); } throw new \RuntimeException($config["adapter"] . ' is not exist'); }