M
M
Msim2015-11-04 23:03:54
PHP
Msim, 2015-11-04 23:03:54

Why does ReactPHP stop execution at 10 seconds (ticks-future)?

$loop->addTimer(0.1, function () use ($loop) {
    $loop->stop();
});

function fooBar($loop) {
    return function () use ($loop) {
        echo 'a';
        $loop->futureTick(fooBar($loop));
    };
}

$loop->futureTick(fooBar($loop));
$loop->run();

c Next is executed indefinitely
$loop->addTimer(0.1, function () use ($loop) {
    $loop->stop();
});

function fooBar($loop) {
    return function () use ($loop) {
        echo 'a';
        $loop->nextTick(fooBar($loop));
    };
}

$loop->nextTick(fooBar($loop));
$loop->run();

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question