Skip to content

Do we really need tick()? #9

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy