What exactly is the purpose of tick() except leaking the internal detail of being "ticked"?
A tick is easily simulated with (using Amp's interface):
$reactor->immediately(function() use ($reactor) {
$reactor->immediately(function() use ($reactor) {
$reactor->stop();
});
});
$reactor->run();
It's a nice helper function, but does it really have to be directly accessible? Also, the only usage for tick()'s I've seen so far is to wait for a single promise, which can be also written as:
$promise->when(function() use ($reactor) {
$reactor->stop();
});
$reactor->run();
What exactly is the purpose of
tick()except leaking the internal detail of being "ticked"?A tick is easily simulated with (using Amp's interface):
It's a nice helper function, but does it really have to be directly accessible? Also, the only usage for
tick()'s I've seen so far is to wait for a single promise, which can be also written as: