Skip to content

Instantly share code, notes, and snippets.

@WyriHaximus
Created January 19, 2015 20:02
Show Gist options
  • Save WyriHaximus/b574d0d1e793b8419f61 to your computer and use it in GitHub Desktop.
Save WyriHaximus/b574d0d1e793b8419f61 to your computer and use it in GitHub Desktop.
return futurePromise($loop)->then(function () use ($loop, $check) {
$result = $check();
if ($result !== false) {
return $result;
}
return tickingFuturePromise($loop, $check);
});
/*$deferred = new Deferred();
$loop->futureTick(function () use ($deferred, $check, $loop) {
$deferred->progress(time());
$result = $check();
if ($result !== false) {
$deferred->resolve($result);
return;
}
tickingFuturePromise($loop, $check)->then(function ($result) use ($deferred) {
$deferred->resolve($result);
});
});
return $deferred->promise();*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment