StockPyle. ¼øÀ§ ¹× ¿ä¾à
- °Ô½ÃÀÚ À̸§:
- Matt Pizzimenti
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://rfacebook.rubyforge.org/
StockPyle. ű×
StockPyle. ¼³¸í
°£´ÜÇÑ ´ÙÁß °èÃþ ½ºÅ丮Áö ¹× ij½Ì API. StockPyleÀº °£´ÜÇÑ Write-Through ij½Ã ½ºÅ丮Áö¸¦ ¸¸µå´Â ¸ñÀûÀ¸·Î ÀÏ·ÃÀÇ ÀúÀå ¿ë±â¸¦ ¼³Á¤ÇÏ´Â °£´ÜÇÑ ¹æ¹ýÀ» Á¦°øÇÏ´Â Python ¸ðµâÀÔ´Ï´Ù .Sage : Memcached ¹× ·ÎÄà ÇÁ·Î¼¼½º ¸Þ¸ð¸®°¡ÀÖ´Â 2 ´Ü°è ij½Ã¸¦ ¼³Á¤ÇÏ´Â °£´ÜÇÑ ½ºÅ©¸³Æ® :¿¡¼ StockPyle °¡Á® ¿À±â MultiStore, Memcachestore, ProcessMemoryStore # ¸ÖƼ ½ºÅä¾î¸¦ ¾²´Â Cachepm = ProcessMemoryStore () MC = Memcachestore (Servers = ) Store = MultiStore () # Ŭ·¡½º¸¦ ¼±¾ðÇÕ´Ï´Ù. °¢ (¹Ù, zap) comporeClass foo (object)¿¡ ´ëÇØ °íÀ¯ÇÕ´Ï´Ù. __stockpyle_keys__ = SA = SQLALCHEMYSTORE () STORE = MultiStore () # ÀúÀå¼Ò¸¦ ÀúÀåÇÕ´Ï´Ù. ij½Ã¸¦ ÅëÇØ µ¥ÀÌÅͺ£À̽º¸¦ ÅëÇØ ¾µ ¼ö ÀÖ½À´Ï´Ù. STQLALCHEMYBACKCLASS () STALLCHEMYBACKCLASS (PERSISTENT_OBJ)´Â MUSTESTORE ¼±¾ð¿¡¼ ¼ø¼¸¦ ÁöÁ¤ÇÕ´Ï´Ù. Ãþ. ÈÄ¼Ó °¡Á® ¿À±â´Â ¸Þ¸ð¸®¸¦ ó¸® ÇÑ ´ÙÀ½ Memcache¸¦ ½ÃµµÇÏ°í ¸¶Ä§³» Database.also¸¦ È®ÀÎÇÕ´Ï´Ù. ¶ÇÇÑ ´Ù¸¥ ¸¸·á¸¦ »ç¿ëÇÏ¿© ÇÁ·Î¼¼½º ¸Þ¸ð¸® ij½Ã¿Í Memcached¸¦ ´Ù¸£°Ô ó¸® ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿¹¸¦ µé¾î ÇÁ·Î¼¼½º ¸Þ¸ð¸®°¡ ºü¸£°Ô ¸¸·á µÉ ¼ö ÀÖÁö¸¸ ½ÇÁ¦·Î ¿©·¯ ½Ã½ºÅÛ¿¡¼ ÀÏ°üµÇ°Ô À¯ÁöÇÒ ¼ö Àֱ⠶§¹®¿¡ Á¶±Ý ´õ ¿À·¡ Áö¼ÓµÉ ¼ö ÀÖ½À´Ï´Ù. ÀÌ ¿¹¿¡¼´Â Foo °´Ã¼°¡ Memcached¿Í ÇÔ²² ·ÎÄà ¸Þ¸ð¸®¿¡¼ ´õ Àû±ØÀûÀ¸·Î ¸¸·á µÉ ¼ö ÀÖ½À´Ï´Ù. PM = ProcessMemoryStore () mc = memcachestore (servers = ) sa = sqlalchemystore () ÀúÀå¼Ò = multistore ( ) # foo °´Ã¼´Â ·ÎÄà ¸Þ¸ð¸®¿¡¼ 60 ÃÊ µ¿¾È Áö¼ÓµÇ¸ç memcachepm.configure¿¡¼ 5 ºÐ (classes = , lifetime = 60) mc.Configure (classes = , lifetime = 5 * 60) ¹°Ã¼ÀÇ ¹«¸®? batch_get : obj1, obj2, obj3 = store.batch_get (foo, ) ¹°Ã¼ÀÇ ¹«¸®¸¦ ÀúÀåÇÏ°í ½Í½À´Ï±î? batch_put : obj1 = foo (111, 777) obj2 = foo (222, 888) obj3 = foo (333, 999) store.batch_put () °´Ã¼ »èÁ¦´Â ½±½À´Ï´Ù (°ð ÀÏ°ý »èÁ¦). Store.Delete (OBJ1) ÀúÀå °¡´ÉÇÑ µµ¿ì¹Ì Ŭ·¡½º¸¦ »ç¿ëÇÏ¿© StockPyle Import StorableClass ¸·´ë (ÀúÀå °¡´ÉÇÑ)¿¡¼ Ŭ·¡½º ¼öÁØ ¾×¼¼½º¸¦ ¾òÀ» ¼ö ÀÖ½À´Ï´Ù. __stockpyle_keys__ = ) ¿ä±¸ »çÇ× : ¡¤ ÆÄÀ̽ã
StockPyle. °ü·Ã ¼ÒÇÁÆ®¿þ¾î