You are here

public function SignalCache::peek in Ultimate Cron 8.2

Get a signal without claiming it.

Parameters

string $job_id: The name of the job.

string $signal: The name of the signal.

Return value

string The signal if any.

Overrides SignalInterface::peek

1 call to SignalCache::peek()
SignalCache::get in src/Signal/SignalCache.php
Get and claim signal.

File

src/Signal/SignalCache.php, line 37

Class

SignalCache

Namespace

Drupal\ultimate_cron\Signal

Code

public function peek($job_id, $signal) {
  $cache = $this->cacheBackend
    ->get("signal-{$job_id}-{$signal}");
  if ($cache) {
    $flushed = $this->cacheBackend
      ->get("flushed-{$job_id}");
    if (!$flushed || $cache->created > $flushed->created) {
      return $cache->data;
    }
  }
  return FALSE;
}