Skip to content

Error: event_base_loop reentrant invocation #24

Description

@Provoker

Hello.
The following code is causing an error:
EventBase::loop(): event_base_loop: reentrant invocation. Only one event_base_loop can run on each event_base at once.

<?php

use React\EventLoop\Loop;
use React\Promise\Deferred;
use function React\Async\await;

require __DIR__  . '/vendor/autoload.php';

Loop::addTimer(0, function () {
	$deferred = new Deferred();
	Loop::addTimer(0, static fn() => $deferred->resolve());
	await($deferred->promise());
});

Tested on ExtEventLoop.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions