crysalead / code
Runs callables with a timeout
Installs: 7 366
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 1
Open Issues: 0
Requires
- php: >=5.5
Requires (Dev)
- crysalead/kahlan: ~2.0
README
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);