hollodotme / fast-cgi-client

A PHP fast CGI client for sending requests (a)synchronously to PHP-FPM
Other
551 stars 34 forks source link

Configurable stream select #77

Open sanderdlm opened 1 year ago

sanderdlm commented 1 year ago

Attempted fix for https://github.com/hollodotme/fast-cgi-client/issues/18. Implemented option 3 from this comment. This timeout now also applies to the multi requests since the getSocketIdsHavingResponse has been reworked to simply use hasResponse in a loop. This is slower than using stream_select on all resources at the same time, but the only way to accurately determine which sockets have responses.

Tried to figure out a test, but couldn't find way to get a socket/check it's timeout just by having the ID. Should we make a basic getSocketById method publicly available? Or $client->sockets->getById?