Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Delay execution
sleep(int $seconds): int
        if ($seconds 1) {

            
usleep($seconds 1000000);

        } else {

            
sleep($seconds);

        }

    }
        $firstLock Cache::lock('foo'1);

        
$this->assertTrue($firstLock->get());

        
sleep(2);



        
$secondLock Cache::lock('foo'10);

        
$this->assertTrue($secondLock->get());
        $firstLock Cache::store('memcached')->lock('bar'1);

        
$this->assertTrue($firstLock->acquire());

        
sleep(2);



        
$secondLock Cache::store('memcached')->lock('bar'10);

        
$this->assertTrue($secondLock->acquire());
        $firstLock Cache::store('redis')->lock('foo'1);

        
$this->assertTrue($firstLock->get());

        
sleep(2);



        
$secondLock Cache::store('redis')->lock('foo'10);

        
$this->assertTrue($secondLock->get());
    public function handle()

    {

        
sleep(1);



        static::
$ran true;

    }
        } elseif ($pid == 0) {

            
$this->setUpRedis();

            
$this->setQueue('phpredis');

            
sleep(1);

            
$this->queue->push(new RedisQueueIntegrationTestJob(12));

            exit;

        } else {
        $this->assertEquals([12], $store);



        
sleep(2);



        (new 
DurationLimiter($this->redis(), 'key'22))->block(0, function () use (&$store) {

            
$store[] = 3;