Perlã§ã¢ãã³ãªãããã¯ã¼ã¯ãµã¼ãã¼ãæ¸ãã«ã¯ - naoyaã®ã¯ã¦ãªãã¤ã¢ãªã¼Kazuho@Cybozu Labs: Comet ã®æ£ãã使ãæ¹ PoCo::HTTP 㧠Comet ãã£ãããµã¼ããä½ã - daily dayflower2007-02-09 - é æ¥è¨ ã¯ã¦ãªæ¯åºcometã®æ±ããåé¡ç¹ã¯ãã¹ãã¡ã¤ã³å¶ç´å°ç¨ãµã¼ãã«ããå ´åãHTTPããã©ã«ãã®80ãã¼ãã¯apacheãªãlighttpdã§ä½¿ãããããã8080ãªã8888ãªãå¥ã®ãã¼ãã使ããã¨ã«ãªãããã®å ´åIEãOperaãªãåé¡ãªãã®ã ããã©ãFireFoxã¯ã¯ãã¹ãã¡ã¤ã³å¶ç´ã«å¼ã£ããã£ã¦XHRã使ããªãããããï¼(ï¼¾oï¼¾)ï¼¼ï¾ ï¾ï¾ï½ºï½¯ï¾ï½²ãããRFC2616ã«ããã¨ãåããã¹ãã«å¯¾ãã¦å¼µããã»ã·ã§ã³ã2ã4ããã®ããè¤æ°ã®ã»ã·ã§ã³ãè²¼ãããã¨ãï¼ex. è¤æ°ã®ãã£ããã«ã¼ã ã«å ¥å®¤ï¼ã¯ãµããã¡ã¤ã³ãåã£ã¦
ãã£ããã®ã¤ãã³ãããªãã³ãã¬ã¼ã ã¯ã¼ã¯ãª POE ã§ããã Comet ã§ãã£ããããã£ã¦ã¿ãããã¨ããããããã§ããã POE::Component::* ã§ã¦ã§ããµã¼ããç«ã¡ä¸ããããã®ã¯ç¾å¨ã®ã¨ããï¼ POE::Component::Server::HTTPServer POE::Component::Server::SimpleHTTP POE::Component::Server::HTTP ã®3ã¤ãããã¾ãã1çªç®ã¯æè¿ inactive ãªã®ã§ãã¹ã2çªç®ã¯ãã¤ãã³ããã¬ã¼ã ã¯ã¼ã¯ãã¸ã®é¦´æã¿ã¯ãããã§ãããSimpleããããªããªã£ã¦ã¾ãã3çªç®ã¯ã³ã¼ã«ããã¯é¢æ°ãç»é²ããã¨ãããæ°æ¥½ã¹ã¿ã¤ã«ãªãã§ããã¡ãã£ã¨éãªæãã ä»åã¯æ¥½ãããããã«3çªç®ã® PoCo::HTTP ã使ã£ã¦ã¿ããã¨æãã¾ããid:naoya æ°ãæè¿ç´¹ä»ãã¦ã¾ãããã URI ã®è¨è¨æéã¯ï¼ ãã£
Cometåå¼·ä¼#1çºè¡¨è³æ-Hello, world! ãèªãã§ãä¸å¹´ã®éã«Cometã©ããªã£ããã ããã¨æã£ã¦Cometã®ãã¨ã調ã¹ã¾ããããã®ä¸ç°ã§ ã5åã§ä½ããã£ããããå®éã«ãã£ã¦ã¿ã - Spirit of Apprenticeship (ã¿ãªããã ã¾ãã) ããã£ã¦ã¿ãã®ã®èªåç¨ã¡ã¢ã§ããåå¼·ä¼åå ãããã£ãï¼ ãã¡ããä¸å¹´åã®è©±é¡ã«ããããã£ã¦ããããã«èª¿ã¹ã¦ããã£ãããIRCãµã¼ãã¨ããªããã®ãHTTPã«ãªããããã«å®è£ ãç´ãããããªãã ããã¨ç解ãããã¨ã«ãã¦ãããã®ã®ããã£ãã調ã¹ã¦ã¿ããç®ããã¦ãã³ãªãã¨å¤æ°ã Meteorã®ãã¼ã¸ã®è§£èª¬ãæç§æ¸çã§ãããããã 調ã¹ã¦ãã¦æãå½¹ã«ç«ã£ãã®ã¯ pure perl ã®cometãµã¼ãå®è£ ã® Meteor ã®ãã¼ã¸ã§ãããCometãµã¼ããè¨è¨å®è£ ããä¸ã§ã®æ¤è¨ãã¹ãç¹ã¨å®è£ ä¸ã®å°é£ã«ã¤ãã¦ã¨ã¦ãããã¾ã¨ã¾ã£ã¦ãã¦ãèª
ã5åãããã§Cometã使ã£ãChatãä½ãæ¹æ³ã ãå®éã«ãã£ã¦ã¿ã¾ããããã¨ã çµè«ããè¨ãã°ããããã°ãã°5åã§ããããããã£ã¦æãã§ãã æé ããç解ã§ãã¦ãã°ã¼ã¡ã¼ã¡ãã£ã¦ã10åã¯ããããªãããããªãããªãã ç·¨éãããã¡ã¤ã«ã¯ãã®ãã¼ã¸ã«è¼ãã¦ããã®ãå ¨ã¦ã ãã ã¦ãã¨ã§ã説æéå§ã ï¼åæï¼ shooting_starã¯gem installæ¸ã¿ã¨ãã¾ã ã¢ããªåãç§å ããã®åç»ã¨éãã®ã¯æ°ã«ããªãã§ä¸ãã ï¼æºåï¼ railsã³ãã³ãã§ã¢ããªã±ã¼ã·ã§ã³çæ $ rails shot_chat create create app/controllers create app/helpers create app/models meteor_strikeãã©ã°ã¤ã³ãã¤ã³ã¹ãã¼ã« $ cd shot_chat $ ./script/plugin install svn://r
This article was migrated from http://rails.office.drecom.jp/takiuchi/archive/181 ShootingStarã使ç¨ãã¦Cometã使ã£ãChatãä½ãæé ãåç»ã«ãã¦ã¿ã¾ããã ShootingStarã¯ãCã¨Rubyã§å®è£ ãããCometãµã¼ãã§ãã RubyForgeã§ãªã¼ãã³ã½ã¼ã¹ããã¸ã§ã¯ãã¨ãã¦éçºãã¦ãã¾ãã http://rubyforge.org/projects/shooting-star/
Comet ã«ã¤ãã¦ã¯ãæ®åãããã©ããã¨ãã以åã«ãã©ã使ãã°ããã®ããæ£ãã使ã£ãå ´åã«ä½ãã©ãã¾ã§ã§ããã®ããã¨ããç解ãå ±æããã¦ããªãããã«æãã¾ãããªã®ã§ã(ããã¾ã§ç§è¦ã§ãã) 使ç¨ããã¹ã©ã¤ãã®ä¸é¨ãå ¬éãããã¨æãã¾ãããããããã°ããããã ããã ãµã¤ãã¦ãºã©ãã®å¥¥ããã«ãã Comet ã®ãµã¼ãã¼å¨ãã®è³æããã°ããããC10K ã«å¯¾ãã¦ã©ã®ãããªã¢ã¼ããã¯ãã£ãã¨ãã®ãè¯ããã¨ã®èå¯ãç¹ã«åå¼·ã«ãªãã¾ããã ã¾ããåé¡ãæ¹åãã¹ãç¹ãããã°ãæãã¦ããã ããã°å¹¸ãã§ãã ã¨ããã®ã§åé¡ãæ¹åãã¹ãã¨ããããã§ã¯ãªãã§ãã Perl å¨ãã®è©±ã§å°ãè£è¶³ãã è³æä¸ã®ãåå¿è ã¸ã®ãªã¹ã¹ã¡ã PoCo::Server::HTTP ã§ããã©ã¼ãã³ã¹ã欲ãã人ã«ã¯ Sys::Syscall qw/:epoll/ãã®ç¹ããããã Perl ã§ã epoll ã使ãã¾ããã¨ããã
Tomcat 6ã§å®ç¾ï¼Ajaxãè¶ ããéä¿¡æè¡Cometï¼Tomcatã¯ã©ãã¾ã§âå®å ¨âã«ã§ããã®ãï¼ï¼3ï¼ï¼1/3 ãã¼ã¸ï¼ Ajaxãè¶ ããï¼ Tomcat 6ã§æè¼ãããCometã¨ã¯ï¼ ååã¯Tomcatãâå®å ¨âã«æ´»ç¨ããããã«ããã¼ã«ã使ã£ãéç¨ã®ä»æ¹ãTomcatã®è¨å®ã«ã¤ãã¦è§£èª¬ãã¾ããã ä»åã¯Tomcatã®å®å ¨æ§ããå°ãé¢ãã¦ãTomcat 6ã®æ°æ©è½ã®å©ç¨æ¹æ³ã«ã¤ãã¦è§£èª¬ãã¾ããTomcat 6ã§ã¯ãããã¤ãã®å¤§ããªæ¡å¼µãããã¾ããããä»åã¯J2SE 1.5ã§å®è£ ãããNew I/O APIï¼java.nioããã±ã¼ã¸ï¼ãç¨ããCometï¼ã³ã¡ããï¼éä¿¡ã«ã¤ãã¦è§£èª¬ãã¾ãã ããããããé常ã®HTTPã§ã®éä¿¡ã é常ã®HTTPã§ã®éä¿¡ã¯ã¯ã©ã¤ã¢ã³ãã®Webãã©ã¦ã¶ãªã©ãããµã¼ãã¸ãªã¯ã¨ã¹ããéä¿¡ãããµã¼ãã¯ãªã¯ã¨ã¹ãã解éãã¦ã¬ã¹ãã³ã¹ãè¿ãã¾ããã¤ã¾ããéä¿¡ã®ã¿ã¤
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}