Skip to content

standard: Take Time\Duration in Io\Poll\Context::wait() - #23092

Draft
TimWolla wants to merge 4 commits into
php:masterfrom
TimWolla:poll-wait-duration
Draft

standard: Take Time\Duration in Io\Poll\Context::wait()#23092
TimWolla wants to merge 4 commits into
php:masterfrom
TimWolla:poll-wait-duration

Conversation

@TimWolla

@TimWolla TimWolla commented Aug 6, 2026

Copy link
Copy Markdown
Member

TimWolla and others added 4 commits August 6, 2026 18:02
…om*()`

This is useful for patterns like the following:

    for (;;) {
        $watchers = $poll->wait(Time\Duration::fromSeconds(1));
        // …
    }

which is repeatedly creating identical duration objects for every loop
iteration.

@arnaud-lb arnaud-lb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants