cache = $cache; } /** * Attempt to obtain an event mutex for the given event. * * @param \Illuminate\Console\Scheduling\Event $event * @return bool */ public function create(Event $event) { return $this->cache->store($this->store)->add( $event->mutexName(), true, $event->expiresAt ); } /** * Determine if an event mutex exists for the given event. * * @param \Illuminate\Console\Scheduling\Event $event * @return bool */ public function exists(Event $event) { return $this->cache->store($this->store)->has($event->mutexName()); } /** * Clear the event mutex for the given event. * * @param \Illuminate\Console\Scheduling\Event $event * @return void */ public function forget(Event $event) { $this->cache->store($this->store)->forget($event->mutexName()); } /** * Specify the cache store that should be used. * * @param string $store * @return $this */ public function useStore($store) { $this->store = $store; return $this; } }