TXZMQ.

Zeromq¿¡ ´ëÇÑ ²¿ÀÎ ¹ÙÀεù
Áö±Ý ´Ù¿î·Îµå

TXZMQ. ¼øÀ§ ¹× ¿ä¾à

±¤°í

  • Rating:
  • ƯÇã:
  • GPL
  • °Ô½ÃÀÚ À̸§:
  • Andrey Smirnov
  • °Ô½ÃÀÚ À¥»çÀÌÆ®:
  • http://smira.ru

TXZMQ. ű×


TXZMQ. ¼³¸í

Zeromq¿¡ ´ëÇÑ Æ®À§½ºÆ® ¹ÙÀεù TXZMQ´Â ½±°Ô Zeromq ¼ÒÄÏÀ» ²¿ÀÎ À̺¥Æ® ·çÇÁ (¿øÀÚ·Î)·Î ÅëÇÕ ÇÒ ¼öÀÖ´Â Python ¶óÀ̺귯¸®ÀÔ´Ï´Ù .TXZMQ´Â ±âº» À̺¥Æ® ·çÇÁ ÅëÇÕÀ» ¼öÇà ÇÒ ¼öÀִ Ŭ·¡½º ZMQConnectionÀÇ Å¬·¡½º zmqconnectionÀÇ Å¬·¡½º zeromq ¼ÒÄÏ¿¡ ´ëÇÑ Áö¿øÀ» ¼Ò°³ÇÕ´Ï´Ù. ÇØ´ç Ŭ·¡½º, ZmqPubConnection ¹× ZmqSubConnectionÀÇ Æ¯¼öÇÑ ´Ï½º ±â´ÉÀ» Pub / Sub SocketsÀÇ Æ¯¼öÇÑ ´Ï½º ±â´ÉÀ» Ãß°¡ÇÏ´Â µ¥À־ ZMQPubConnection ¹× ZmqSubConnectionÀÇ Æ¯¼ö ±â´ÉÀ» Ãß°¡ ÇÒ ¼ö ÀÖ½À´Ï´Ù. Áï½Ã ¸Þ½ÃÁö¸¦ ¼ö½ÅÇϸé (ÇöÀç »ç¿ë °¡´ÉÇÑ ¸Þ½ÃÁö¸¦ ÀÐ°í ´ë±âÁßÀÎ ¸Þ½ÃÁö¸¦ º´·Ä·Î ÀÐÀ¸·Á°í ½ÃµµÇÕ´Ï´Ù) .Example : °¡Á® ¿À±â SysFrom OptParse OptionParserfrom Twisted.Internet °¡Á® ¿À±â ¹ÝÀÀ±â, DeferFrom Twisted.python import LogObserver = log.fileLogObserver (sys.stderr) log.addobserver (observer.emit) parser = optionParser ( "") parser.add_option ( "- m", "--method", dest = "method", help = "0mq ¼ÒÄÏ" ¿¬°á : ¹ÙÀεå | ¿¬°á ") parser.add_option ("- e ","- endpoint ", dest ="³¡Á¡ ", help ="0mq ³¡Á¡ ") parser.add_option ("- m ","- mode ", dest = "mode", help = "mode : publisher | °¡ÀÔÀÚ") parser.set_defaults (method = "connect", endpoint = "epgm : // eth1; 239.0.5.3 : 10011") (¿É¼Ç, args) = Æļ­. txzmq °¡Á® ¿À±â zmqfactory, zmqencepoint, zmqpubconnection, zmqpubconnectionimport timezf = zmqfactory () zmq_ode (options.method, options.endpoint)¿¡¼­ options.mode == "publisher": s = zmpubconnection (zf, e) def publish () : data = str (time.time ()) "publishing % r"% µ¥ÀÌÅÍ s.publish (µ¥ÀÌÅÍ) Reautor.Calllater (1, °Ô½Ã) °Ô½Ã () else : s = zmqsubconnection (zf, e) s. ±¸µ¶ ( "") DEF DEF DEPRINT (* ARGS) : Àμâ "¸Þ½ÃÁö ¼ö½Å : % r"% (args,) s.gotmessage = doprintreactor.run () ¿ä±¸ »çÇ× : ¡¤ ÆÄÀ̽㠡¤ Zeromq ¶óÀ̺귯¸®> = 2.1 (2.1.4·Î Å©°Ô Å×½ºÆ® µÊ) ¡¤ PYZMQ. ¡¤ Æ®À§½ºÆ®


TXZMQ. °ü·Ã ¼ÒÇÁÆ®¿þ¾î