Ruby & WebSockets: TCP for the Browser â igvita.comãåèã«ããã ã§ãã http://dev.shokai.org/test/ws/chat/ ã½ã¼ã¹ã³ã¼ã https://github.com/shokai/ruby-websocket-test websocketãªã®ã§chromeãsafariãiPhoneã§åããã©ãFirefoxã¨IEã§ã¯åããªãã â ãµã¼ãã¼ ãµã¼ãã¼ã¯rubyã®EventMachine::WebSocketã使ã£ãã ã¾ãgemã§ã¤ã³ã¹ãã¼ã«ãã¦ãã㦠gem install em-websocket EM::runã®ä¸ã§EM::WebSocket.startããã ãã 1ããã»ã¹ã«è¤æ°ã¯ã©ã¤ã¢ã³ãã¤ãªãã£ã±ãªãã«ãã¦ãå ¨ã¯ã©ã¤ã¢ã³ãã«ã¾ã¨ãã¦ã¡ãã»ã¼ã¸ãéãããã«EM::Channelã使ã£ããEM::W
Herokuã®ã¯ã¼ã«ããã»ã¹ã¯ãcrashããå ´åã«èªåçã«åèµ·åãã¦ãããããã§ãã®ã§ãEventMachineã使ã£ãã¹ã¯ãªãããåããã®ã«ã¯æé©ã§ãããã¨ãã°ãTwitterãç£è¦ããããã¤ãã³ãã»ããªãã³ãå®æçã«å®æ½ãããå¦çã®å ´åã«ãå§ãã§ãã ã¾ããä»åEventMachineã®ã¹ã¯ãªããåä½ã§ã¯ãªããRailsã«çµã¿è¾¼ã¿ã¾ãããçç±ã¯åãRailsã®ãã¬ã¼ã ã¯ã¼ã¯ã«æ £ããã£ã¦ãRSpecã®ãã¹ãæ¸ãããã便å©ãªgemã使ããããããã§ããå¤åãçç£æ§ã®é«ãã¨ãRailsã®ãªã¼ãã¼ãããã¨ã®å ¼ãåãã ã¨æãã¾ãã ð³ åç½®ãï¼ããã¸ã§ã¯ããæ°è¦ä½æããå ´åãRails4 x herokuç¨ã®Application Templateãä½ã£ã¦ã¿ãï¼ãã®ã³ãã³ãã§ããã¸ã§ã¯ããä½æããã¨EventMachineã使ããã®è³ªåãåºãã®ã§ãyesã¨æã£ã¦ããã ããã°ãèªåçã«æ¬¡ã®ã³ã¼
並å1000ã³ãã¯ã·ã§ã³ã«èããï¼ Ruby ã®ã¤ãã³ãé§åã©ã¤ãã©ãª Rev 㨠EventMachine ã® HTTPã¯ã©ã¤ã¢ã³ã ããã«ã¡ã¯ãtakada-at ã§ãã Rubyã®ã¤ãã³ãé§ååãããã¯ã¼ã¯ããã°ã©ãã³ã°ãã¬ã¼ã ã¯ã¼ã¯ Rev 㨠EventMachine 㧠HTTPã¯ã©ã¤ã¢ã³ããåããã¦ã¿ã¾ããã ã¤ãã³ãé§ååãããã¯ã¼ã¯ããã°ã©ãã³ã°ãã¬ã¼ã ã¯ã¼ã¯ã¨ã¯ä½ã説æãã ãã¨é£ããã§ãããä¸è¨ã§è¨ãã¨ã以ä¸ã®ããã«ãªãã¾ãã # ãµã¤ãã®ããã¼é§ååããã°ã©ã Net::HTTP.start(host, port){|http| res = http.get(path) #ãã®å¦çãçµãã£ã¦ãã } puts "done" #ãã®æ¬¡ã®å¦çãå®è¡ããã # ã¤ãã³ãé§ååããã°ã©ã client = Rev::HttpClient::connect(host, port
dan sinclairããã®EventMachineã®å ¥éè¨äºï¼PDFï¼ã翻訳ãã¾ããã åæã¯ãããããã¦ã³ãã¼ãå¯è½ã§ãï¼ http://everburning.com/news/eventmachine-introductions/ ï¼ç¿»è¨³ã®å ¬éã¨ç»åã®å©ç¨ã¯æ¬äººãã許諾æ¸ã¿ã§ãï¼ ç¿»è¨³ã»å 容ã®ééãçãããã°ããã°ã³ã¡ã³ããTwitterãªã©ã§é æ ®ç¡ããææãã ããã EventMachineå ¥é Introduction ãããããããä½ãå¦ã¶ãã¨ã«ãªãã®ãããã®å°å ¥ã®ãã ããã¹ã¿ã¼ãå°ç¹ã¨ãã¦å½¹ã«ç«ã¤ã¨æããEventMachine ã¨ã¯ä½ã ãããããã¦ããã¯ç§ãã¡ã®ããã«ä½ããã¦ãããã®ã ããããã¦ãæåã®é¨åã¯ç°¡åã ããEventMachine 㯠Reactor ãã¿ã¼ã³(*1)ã®é«æ§è½ãªå®è£ ãã ãããããããã¡ãã£ã¨å¾ ã¦ãReactor ãã¿ã¼ã³ã£ã¦ä½ã ï¼ãWiki
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}