Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve error reporting when incorrectly using await() (Value of type null is not callable in src/SimpleFiber.php:66) #50

Open
Labels
help wantedExtra attention is needed new featureNew feature or request
@greendrake

Description

Reproduce:

use React\EventLoop\Factory as Loop;
use React\Async;
use React\Promise\Deferred;
$loop = Loop::create();
$deferred = new Deferred;
$promise = $deferred->promise();
$loop->addTimer(0.02, function() use($deferred) {
 $deferred->resolve();
});
$foo = function() use($promise) {
 Async\await($promise);
 echo 'All good' . PHP_EOL; 
};
$loop->addTimer(0.01, $foo);
$loop->run();

How to fix it is known: wrap $foo into Async\async. But the error sucks anyway. You guys gotta find a way to get it either work anyway, or throw a nice error telling us what is wrong and hinting what to do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed new featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /