msgpack-rpc-python. ¼øÀ§ ¹× ¿ä¾à
- ƯÇã:
- The Apache License 2.0
- °Ô½ÃÀÚ À̸§:
- Masahiro Nakagawa
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- https://github.com/msgpack/
msgpack-rpc-python. ű×
msgpack-rpc-python. ¼³¸í
MSGPACK-RPC-PythonÀº ¸Å¿ì È¿À²ÀûÀÎ °´Ã¼ Á÷·ÄÈ ¶óÀ̺귯¸®ÀÔ´Ï´Ù. ±×°ÍÀº JSON°ú °°Áö¸¸ ¸Å¿ì ºü¸£°í ÀÛÀº °ÍÀÔ´Ï´Ù. ¸Þ½ÃÁö ÆÑ? MessagePackÀº ¹ÙÀ̳ʸ® ±â¹Ý È¿À²ÀûÀÎ °´Ã¼ Á÷·ÄÈ ¶óÀ̺귯¸®ÀÔ´Ï´Ù. JSON°ú °°Àº ¸¹Àº ¾ð¾î°£¿¡ ±¸Á¶È µÈ °´Ã¼¸¦ ±³È¯ ÇÒ ¼ö ÀÖ½À´Ï´Ù. ±×·¯³ª JSON°ú´Â ´Þ¸® ¸Å¿ì ºü¸£°í ÀÛÀº Á¤¼ö (°°Àº Ç÷¡±× ¶Ç´Â ¿À·ù ÄÚµå)°¡ 1 ¹ÙÀÌÆ® ´ÜÀ§·Î ÀúÀåµÇ¸ç ÀϹÝÀûÀΠªÀº ¹®ÀÚ¿Àº ¹®ÀÚ¿ ÀÚüÀÇ ±æÀ̸¦ Á¦¿ÜÇÏ°í 1 ¹ÙÀÌÆ® ¸¸ ÇÊ¿äÇÕ´Ï´Ù. (3 ¿ä¼Ò ¹è¿)´Â ´ÙÀ½°ú °°ÀÌ messagePackÀ» »ç¿ëÇÏ¿© 4 ¹ÙÀÌÆ®·Î Á÷·Äȵ˴ϴÙ. 'msgpack'msg = .to_msgpack # => "\ x93 \ x01 \ x02 \ x03" messagePack.unpack (msg) # => messagePack-RPC´Â Ŭ¶óÀ̾ðÆ®, ¼¹ö ¹× Ŭ·¯½ºÅÍ ÀÀ¿ë ÇÁ·Î±×·¥À»À§ÇÑ ±³Â÷ ¾ð¾î RPC ¶óÀ̺귯¸®ÀÔ´Ï´Ù. º¹ÀâÇÑ ³×Æ®¿öÅ© ÇÁ·Î±×·¡¹Ö¿¡¼ ¿ÏÀüÈ÷ ¿ÏÀüÈ÷ ¸±¸®½ºµÇ°í Àß ¼³°èµÈ API¸¦ Á¦°øÇϹǷΠmessagepack-rpc.require 'msgpack / rpc'class myHandler def return x + y endendsvr = messagepackÀ¸·Î °í±Þ ³×Æ®¿öÅ© ÀÀ¿ë ÇÁ·Î±×·¥À» ½±°Ô ±¸ÇöÇÒ ¼ö ÀÖ½À´Ï´Ù :: rpc :: server.newsvr.listen ( '0.0.0.0', 18800, myhandler.new) svr.runrequire 'msgpack / rpc'c = messagepack :: rpc :: client.new ('127.0.0.1 ', 18800 ) °á°ú = C.CALL (: 1, 2) # => 3 °³ ½ÃÀÛÇϱ⠰¢ ¾ð¾îÀÇ ±¸Çö¿¡ ´ëÇÑ ±âŸ ¹®¼´Â À¥ »çÀÌÆ®¿¡¼ ¹ß°ßµË´Ï´Ù. Á¦Ç°ÀÇ È¨ÆäÀÌÁö
msgpack-rpc-python. °ü·Ã ¼ÒÇÁÆ®¿þ¾î