Closed Bilge closed 6 years ago
Internally, it create php processes (or threads depend on your php configuration) that execute this function, which have been serialized. I think the documentation is more clear about this here : https://amphp.org/parallel-functions/
Oh I see, I thought Amp was all about coroutines, but nevertheless that is very clever and may indeed be some kind of breakthrough. 👍
@Bilge Don't worry about questions in the issue tracker. Amp is mainly focused on non-blocking I/O, correct, but it can also do multi-processing. Consumers don't have to care, they get a promise either way. We also already used threading via libuv
for filesystem access before.
Care to provide a PR to replicate the note from the docs into the README?
Would love to, but if you observe my contribution history you may notice I'm a little busy at the moment.
Sorry for posting a question in your issue tracker, but I don't understand how the following is possible.
I was told, in no uncertain terms, that such a thing would be impossible using async because
file_get_contents()
is, and always will be, a synchronous blocking operation. That is why Artax was created. If this is no longer the case then this is a breakthrough, but if not, and this library is actually using threads instead of coroutines, I think this should be clearly stated in the readme to avoid confusion.