ÄÚµà·ÎÀ̺ñµ¿±â½Ä CouchDB Ŭ¶óÀ̾ðÆ® ¶óÀ̺귯¸® | |
Áö±Ý ´Ù¿î·Îµå |
ÄÚµà·ÎÀÌ ¼øÀ§ ¹× ¿ä¾à
±¤°í
- ƯÇã:
- BSD License
- °¡°Ý:
- FREE
- °Ô½ÃÀÚ À̸§:
- Christian Swinehart
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://samizdat.cc/
ÄÚµà·ÎÀÌ Å±×
ÄÚµà·ÎÀÌ ¼³¸í
Corduroy´Â CouchDBÀÇ HTTP ±â¹Ý API ÁÖÀ§¿¡ ÆÄÀ̽ã Ä£ÈÀû ÀÎ ·¡ÆÛ¸¦ Á¦°øÇÏ´Â Python ¸ðµâÀÔ´Ï´Ù. Àå¸é µÚ¿¡´Â Åä³×À̵µ ¶Ç´Â ¿äû ¹× GEVENT ¸ðµâÀ» ¼±ÅÃÇÑ ºñµ¿±â½Ä I / O ·çƾ¿¡ ¿¬°áÇÕ´Ï´Ù. Corduroy´Â ¼¹öÀÇ À̺¥Æ® ·çÇÁ¸¦ Â÷´ÜÇÏÁö ¾Ê°í µ¥ÀÌÅͺ£À̽º¸¦ Äõ¸® ÇÒ ¼ö ÀÖÀ¸¹Ç·Î CouchApp ¸¶ÀÌÅ©·Î ¹Ìµé¿þ¾î ¶Ç´Â ½ºÅ©¸³Æ® ÀÏ°ý 󸮿¡ ÀÌ»óÀûÀÔ´Ï´Ù. .USAGEAS Corduroy¿Í ÇÔ²² ÀÏÇÏ´Â ½ÇÁ¦ ¼¼°è (ISH), URL ÁöÁ¤ ¹®¼¸¦ ¾÷µ¥ÀÌÆ® ÇÑ ´ÙÀ½º¸±â¸¦ Äõ¸®ÇÏ´ÂÀÌ ½ÖÀÇ Åä³×À̵µ À̺¥Æ® Çڵ鷯¸¦ °í·ÁÇϽʽÿÀ. ù ¹ø°´Â µ¥ÀÌÅͺ£À̽ºÀÇ °¢ ÀÀ´äÀÌ ¼ö½Å µÈ ÈÄ¿¡ ½ÇÇàÀ» Àç°³Çϱâ À§ÇØ ¸í½ÃÀûÀÎ ÄݹéÀ» »ç¿ëÇÕ´Ï´Ù. .new_score = int (self.request.body) db.get (player_id, callback = self.got_player) def got_player (doc, status) : doc.score = self.new_score db.save (doc, callback = self.saved_player) def saved_player (Ãæµ¹, »óÅÂ) : db.view ( '¸®´õ º¸µå / ÇÏÀÌ ½ºÄÚ¾î', callback = self.got_highscores) def got_highscores (Çà, »óÅÂ) : self.write (json.dumps (Çà)) self.finish () ´ë¾È @Relax Decorator¸¦ »ç¿ëÇÏ¿© ±¸¹®À» »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù (Åä³×À̵µ¸¦ »ç¿ëÇÏ´Â °æ¿ì). °¢ µ¥ÀÌÅͺ£À̽º Á¶ÀÛ¿¡ ´ëÇÑ ÄݹéÀ» Á¤ÀÇÇÏ´Â ´ë½Å ¶óÀ̺귯¸®¸¦ À²¹ýÀÇ ÀϺηΠȣÃâ ÇÒ ¼ö ÀÖ½À´Ï´Ù .TornadoÀÇ »ý¼º±â ¸ðµâÀº ÀÌ·¯ÇÑ ¼öÈ®·®À» °¡·Î ç ¼ö ÀÖÀ¸¸ç ÄݹéÀ» ÀÚµ¿À¸·Î Á¦°øÇÕ´Ï´Ù. °á°ú´Â ²Ï ¼øÂ÷ÀûÀ¸·Î º¸ÀÌ´Â ÄÚµåÀÌÁö¸¸ Class RankingSupdater (tornado.web.requesthandler) : @ReLax Def Post (self, player_id) : #ÀÌ Ç÷¹À̾îÀÇ Á¡¼ö Doc = DB.GET (player_id) docÀ» ÀÍÈ÷½Ê½Ã¿À. Score = int (self.request.body) db.save (doc) # »õ ¼øÀ§¸¦ ¹ÝȯÇÕ´Ï´Ù. highscores = db.view ( '¸®´õ º¸µå / ÇÏÀÌ ½ºÄÚ¾î') self.write (json.dumps (highscores)) self.finish ( ) Corduroy (¹× Couchdb ÀϹÝÀûÀ¸·Î couchdb)¿¡ ºÎµå·´°Ô ¼Ò°³Çϱâ À§ÇØ °¡À̵带 »ìÆ캸½Ê½Ã¿À. ¸ðµç CorduroyÀÇ ¸ðµâ ¼öÁØÀÇ Å¬·¡½º¿¡ ´ëÇÑ ¹®¼´Â ÂüÁ¶ ¼½¼Ç¿¡¼ ãÀ» ¼ö ÀÖ½À´Ï´Ù. ¼³Ä¡ SautomationCorduroy´Â PYPI¿¡¼ ãÀ» ¼ö ÀÖÀ¸¸ç PIP ¶Ç´Â EASY_INSTALL.MANUAL ¼³Ä¡¸¦ ¼±ÅÃÇÒ ¼ö ÀÖ½À´Ï´Ù. CORDUROY-0.9.0.TAR.GZ : TAR XVZF Corduroy-0.9.0.tar.gzcd Corduroy-0.9.0python setup.py installdependenceies Åä³×À̵µ ¾ÛÀ» ÀÛ¼ºÇÏ°í, Corduroy´Â ´ÙÀ½°ú °°ÀÌ ¼³Ä¡ÇÏ¿© Pure-Python HTTP Ŭ¶óÀ̾ðÆ®¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. libcurlÀ» ¼±È£ÇÏ´Â °æ¿ì Corduroy Tornadoor¸¦ ¼³Ä¡ÇϽʽÿÀ. -based Ŭ¶óÀ̾ðÆ® (Ç®¸µ ¹× ±âŸ niceties Áö¿ø) : pip ¼³Ä¡ ÄÚµà·ÎÀÌ Åä³×À̵µ pycurlif pycurl ºÒÆò (´ç½ÅÀ» ã°í ÀÖ½À´Ï´Ù, os x), ½Ãµµ : env archflags = "- arch x86_64"pip ¼³Ä¡ pycurlgevent »ç¿ëÀÚ´Â ÇÔ²² ¼³Ä¡ÇÒ ¼ö ÀÖ½À´Ï´Ù : PIP ¼³Ä¡ ÄÚµà·ÎÀÌ ¿äû GEVENT ¶óÀ̺귯¸®´Â ÀÏ¹Ý ¿À·¡µÈ Â÷´Ü I / O : PIP ¼³Ä¡ Corduroy RequestsProductÀÇ È¨ÆäÀÌÁö¸¦ ¼³Ä¡ÇÒ ¼öµµ ÀÖ½À´Ï´Ù.
ÄÚµà·ÎÀÌ °ü·Ã ¼ÒÇÁÆ®¿þ¾î