You are here

public static function UltimateCronSignalCache::get in Ultimate Cron 7.2

Get and claim signal.

Parameters

string $name: The name of the job.

string $signal: The name of the signal.

Return value

string The signal if any. If a signal is found, it is "claimed" and therefore cannot be claimed again.

File

./ultimate_cron.cache-signal.inc, line 46
File containing functions for Ultimate Cron signal handling using cache.

Class

UltimateCronSignalCache
Class for handling Ultimate Cron signals.

Code

public static function get($name, $signal) {
  if (lock_acquire("signal-{$name}-{$signal}")) {
    $result = self::peek($name, $signal);
    self::clear($name, $signal);
    lock_release("signal-{$name}-{$signal}");
    return $result;
  }
  return FALSE;
}