Runs callables with a timeout

Installs: 7 367

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 1

Open Issues: 0

pkg:composer/crysalead/code

2.0.0 2015-12-06 04:18 UTC

This package is auto-updated.

Last update: 2025-09-29 02:05:43 UTC


README

Build Status Code Coverage

API

Runs a callable until a timeout is reached:

declare(ticks = 1);

Code::run(function(){
    sleep(100);
}, 10);

Runs a callable in loop until a timeout is reached and the return value is false:

// declare(ticks = 1); is optionnal when the callable is not blocking on spinning mode

Code::spin(function(){
    sleep(1);
    return false;
}, 10);