Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore spurious resumes on {main} suspension #88

Merged

Conversation

danog
Copy link
Contributor

@danog danog commented Nov 16, 2023

Avoids issues with this reproducer:

<?php

use Amp\DeferredFuture;
use Revolt\EventLoop;

require 'vendor/autoload.php';

$f = new DeferredFuture;

EventLoop::queue(fn () => throw new \Error());
EventLoop::queue($f->complete(...), "Not an integer");

try {
    var_dump($f->getFuture()->await());
} catch (\Throwable) {}

function test(): int {
    $f2 = new DeferredFuture;
    EventLoop::queue($f2->complete(...), 321);
    return $f2->getFuture()->await();
}

var_dump(test());

@trowski trowski merged commit cfed1a9 into revoltphp:rethrow-from-suspension Nov 18, 2023
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants