4 ms·
>Asynchronously curl’ing to localhost (or even another web server) provides a shared-nothing, copy-in/copy-out way of exploiting parallelism Wait, wait, wait,
by Tehnix 10y ago
>Asynchronously curl’ing to localhost (or even another web server) provides a shared-nothing, copy-in/copy-out way of exploiting parallelism
Wait, wait, wait, wait. Is he saying that to do async work he'll send a curl request to somewhere (spawning a thread for that request), not wait on the output and carry on? Last I used curl in php it was a synchronous action. Hell of a threading model there.
- Zachery 10y agoYou can do some decidedly hacky stuff with PHP if you are smart about it. To get background tasks to run in a popular forum software, the system would send an ajax request to the cron script. The cron script would return a 1x1 clear gif and "close" the connection. The script would then be run in "in the background". It would be easy to do the same thing there. curl another script and have it instantly return nothing while it continues to process.