Skip to content

Report IoPollDriver as supported on the Io\Poll polyfill - #146

Merged
kelunik merged 2 commits into
mainfrom
io-poll-polyfill-supported
Nov 14, 2026
Merged

kelunik merged 2 commits into
mainfrom
io-poll-polyfill-supported

Conversation

@kelunik

@kelunik kelunik commented Nov 14, 2026

Copy link
Copy Markdown
Member

isSupported() now reports whether the driver can run, which includes symfony/polyfill-io-poll below PHP 8.6, also on Windows, where the polyfill is backed by stream_select() instead of WSAPoll. DriverFactory still only picks the driver automatically on PHP 8.6+, as the polyfill is slower than StreamSelectDriver.

The tests now skip based on isSupported(), and a Windows job with the polyfill verifies it works there. The README mentions the driver.

kelunik and others added 2 commits November 14, 2026 19:21
isSupported() now reports whether the driver can run, which includes
symfony/polyfill-io-poll below PHP 8.6, also on Windows, where the
polyfill is backed by stream_select() instead of WSAPoll. DriverFactory
still only picks the driver automatically on PHP 8.6+, as the polyfill
is slower than StreamSelectDriver.

The tests now skip based on isSupported(), and a Windows job with the
polyfill verifies it works there. The README mentions the driver.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Winsock reports a failed non-blocking connect() only in select()'s
except set, which the polyfill does not pass to stream_select(), so
writable callbacks on such sockets never run. Treat Windows as
unsupported for the polyfill too, like for native WSAPoll, and disable
the Windows polyfill CI job until the polyfill handles this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kelunik
kelunik merged commit 93999a4 into main Nov 14, 2026
18 checks passed
@kelunik
kelunik deleted the io-poll-polyfill-supported branch November 14, 2026 19:05
nicolas-grekas added a commit to symfony/polyfill that referenced this pull request Nov 15, 2026
…nicolas-grekas)

This PR was merged into the 1.x branch.

Discussion
----------

[Io/Poll] Report failed async connects on Windows

Winsock reports a failed non-blocking connect() only in select()'s exceptfds, never in writefds, so a watcher waiting for Event::Write on such a socket was never woken up. On Windows, also select the write-watched streams for exceptions and report a stream flagged there without a peer as Write|Error|HangUp, like poll() does.

Please verify the behavior is correct on Windows using the Revolt test suite: revoltphp/event-loop#146

Commits
-------

95cc758 [Io/Poll] Report failed connects for all watchers and fix 32-bit timeouts
9f55250 [Io/Poll] Report failed async connects on Windows
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