çºç«¯
ææã§ãæè¿ã®PHPã®curlã©ã¤ãã©ãªã¯ãã©ã¬ã«åå¾ã§ãããã¨ããã¦ãã¨ããªãã§ãPHPã£ã¦åºæ¬ã·ã³ã°ã«ã¹ã¬ããã ãã¤ãã³ãã«ã¼ãã¿ãããªæ©æ§ããªãã¨èªèãã¦ããã ãã©ãã£ã¦æã£ã¦èª¿ã¹ãã
追è¨:ã¨æã£ããããã®è¨äºãæ¸ããå¾ããã«èª¿ã¹ãããããããPHP ã«ã¯ stream_select ãªã© IO å¤éåããµãã¼ãããé¢æ°ç¾¤ããã£ããä¸åå¼·ã§ãã£ãã
ãªã«ã¯ã¨ãããããã¥ã¡ã³ãã«ãããã
PHPã¯å ¬å¼ã®ããã¥ã¡ã³ããå å®ãã¦ãã¦ãã°ããããããã¯ç´ ç´ã«èªããã¹ãPHPã®ç¾ç¹ã ã¨æãã
ãã¼ããªããè¦ãæãCã§ä¸¦åæ§ãå¸åãã¦ãã®ããªï¼ã¨ããæãã®ä½ã¬ãã«APIã¸ã®ã°ã«ã¼æããããå®éã«ã½ã¼ã¹ãèªãã§ã¿ã
ã½ã¼ã¹ãèªã
https://github.com/php/php-src/blob/85d05b5654cbbbf6f741d7f9be13136746ff8c35/ext/curl/multi.c#L198
å®éã«ä¸¦åã§ãªã¯ã¨ã¹ãæãã curl_multi_exec é¢æ°(ããã¤èªä½ã¯ããããã³ã°ããªãããã®ãã¨curl_multi_select ãªã©ã®ããããã³ã°ããé¢æ°ã§ã¬ã¹ãã³ã¹ãå¾ ã¤)ã®å®ç¾©ãè¦ã«è¡ãã¨ãä¸ã§ãcurl_multi_performããå¼ãã§ããããã®curl_multi_performã¯ã©ããã libcurl ã§å®ç¾©ããã¦ããã£ã½ããæ³åéã並åã®é¨åã¯Cã¬ãã«ã§å¸åãã¦è§£æ±ºãã¦ããããã ããã®ä»ã®é¢æ°ãæ³åéãã©ãããlibcurlã¸å¦çãå§è²ãã¦ããã ãã
ã¤ã¾ããPHPã®curlã©ã¤ãã©ãªããã©ã¬ã«ã§åå¾ã§ããã¨ããããã¯ãããããlibcurlã«ããããæ©æ§ãçµã¿è¾¼ã¾ãã¦ãã¦ãPHPã¯ããã¸ã®ã°ã«ã¼ãæä¾ãã¦ããã¨ãã話ã¿ããã
ææ
åç´ã«ãªãã»ã©ã¨ããæãããããPerl ã Ruby ã®æåã ã¨ããã®è¨èªèªä½ãè¨èªãæ¡å¼µããã¿ãããªæåãããããã«æãï¼Perl ã 㨠Moose ã¨ã Ruby ã 㨠ActiveSupport ã¨ãï¼ãã©ãPHP ã®å ´åã¯ããã¯çµæ§æ£²ã¿åãããã£ã¦ããPHP ã§ã§ãããã¨ãã®ä¸ã«ãPHP ãã®ãã®ãæ¡å¼µãããã£ã¦ã®ã¯å ¥ããªãæåã§ããã¨æãããããã«ãã£ã¦ãPHPã«ã¸ã¥ã¢ã«ã¦ã¼ã¶ã¼ãã¯PHPã®ä¸çã ãã§è¡ãã¦è¡ããããPHPãã´ã£ã¦ã¼ã¶ã¼ãã¯Cã¬ãã«ã§PHPã®æ¡å¼µã¢ã¸ã¥ã¼ã«ã¨ãæ¸ãã¨ããPHPèªä½ãæ¡å¼µãã¡ããï¼Hackã¨ãï¼ã¨ããæãã ããªãããã¯ããã§ã²ã¨ã¤ã®èãæ¹ã ããªãã¨æããã