amphp / http-client

An advanced async HTTP client library for PHP, enabling efficient, non-blocking, and concurrent requests and responses.

Home Page:https://amphp.org/http-client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does \tempnam blocks event loop? (streaming example)

Guuzen opened this issue · comments

PHP docs states that "tempnam — Create file with unique file name" so looks like it is io operation.

$path = \tempnam(\sys_get_temp_dir(), "artax-streaming-");

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.