Skip to content

Do we really need tick()? #9

Closed
Closed
@bwoebi

Description

@bwoebi

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();

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions