amphp / http-client

An advanced async HTTP client library for PHP, enabling efficient, non-blocking, and concurrent requests and responses.
https://amphp.org/http-client
MIT License
706 stars 66 forks source link

Does \tempnam blocks event loop? (streaming example) #288

Closed Guuzen closed 3 years ago

Guuzen commented 3 years ago

PHP docs states that "tempnam — Create file with unique file name" so looks like it is io operation. https://github.com/amphp/http-client/blob/ac286c0a2bf1bf175b08aa89d3086d1e9be03985/examples/streaming/2-http1-http2.php#L42

kelunik commented 3 years ago

Yes, it's an IO operation, but usually very short. Depending on your application, this short blocking might be acceptable, but it obviously depends on the frequency with which you create such files.