éå§ãã
éçºã¯æåããå éãããŠãããç§ã®ã¢ããªã±ãŒã·ã§ã³ã«å¿ èŠãªã»ãšãã©ãã¹ãŠã®å¿ èŠãªæ©èœã¯ããµãŒãããŒãã£ã®ã©ã€ãã©ãªãšããŠã€ã³ã¿ãŒãããäžã§è±å¯ã«å©çšã§ããŸããã ãŸããScalaå°çšã«ãŸã èšè¿°ãããŠããªããã®ã®äžè¶³ã¯ãJavaã®ããŸããŸãªã³ã³ããŒãã³ãã®è±å¯ãªå€æ§æ§ã«ãã£ãŠè£ãããŠããŸãã ãã ããåé¡ã¯ããã€ãã®ããã«ãäºæããªãå Žæã§çºçããŸããã
å®éãããæç¹ã§ãã¢ããªã±ãŒã·ã§ã³ã¯IMAPãµãŒããŒã«æ¥ç¶ããŠãåä¿¡ããã¡ãŒã«ã¡ãã»ãŒãžãèªã¿åã£ãŠåŠçããå¿ èŠããããŸãã ãããŠãã¢ã¯ã¿ãŒã¢ãã«ã¯ãããã¯ãŒã¯ãšã®éåæäœæ¥ãæå³ãããããæ°ããã¢ããªã±ãŒã·ã§ã³ã®æ§é ã«çŸããææ©çã«é©åããããã«ãã¡ãŒã«ãµãŒããŒã«æ¥ç¶ããŠã¡ãŒã«ãéåæã«åä¿¡ã§ããã©ã€ãã©ãªãå¿ èŠã§ããã çãæ€çŽ¢ã®åŸãakka-camelã¢ãžã¥ãŒã«ã«åºäŒããŸããããã®ã¢ãžã¥ãŒã«ã䜿çšãããšã俳åªã®ã¡ãã»ãŒãžãã£ãã«ãšããŠapache-camelã©ã€ãã©ãªã䜿çšã§ããŸãã ãããŠãã©ã¯ãã¯ãå€æããããã«ããšãããã¡ãŒã«ãµãŒããŒã«æ¥ç¶ã§ããŸãã ããã«ãå¿ èŠãªæ¥ç¶ãã©ã¡ãŒã¿ãŒãæå®ããå Žåãã©ã¯ãã¯æ°é®®ãªïŒ\ RecentïŒãã©ã°ã®èªã¿åããèªã¿åãã¡ãã»ãŒãžã®åé€ããŸãã¯ç¹å¥ã«äœæããããã©ã«ããŒãžã®ã³ããŒ/移åã®ã¿ãè¡ãããšãã§ããŸãã ãã£ãšå€¢ãèŠãããšããã§ããŸããã§ããã SBTãéå§ããã«ã¯ãäŸåé¢ä¿akka-camelãcamel-coreãããã³camel-mailã«ã€ããŠèšåããã ãã§ããã
æåã®è©Šã¿
ã¢ã¯ã¿ãŒãäœæãããããIMAPãµãŒããŒã«æ¥ç¶ããã«ã¯ãã»ãã®æ°è¡ã®ã³ãŒããå¿ èŠã§ããã ãããŠãã¢ããªã±ãŒã·ã§ã³ãã°ã§ã¯ãã¡ãã»ãŒãžã®ããã¹ããèœã¡ãŸãããç§èªèº«ããã¹ãã®ããã«ã¡ãŒã«ã«éä¿¡ããŸããã ç§ã¯ãã§ã«æºè¶³ããŠæããããå§ãã次ã®ã¿ã¹ã¯ã«ã€ããŠèãå§ããŸããããçµæãšããŠåŠçã®ããã«ã¡ãŒã«ãåãåãã¯ãŒã¯ããã¯ã¹ã«æ¥ç¶ããããšããå Žåã®ããã ãã«æ±ºããŸããã ãããŠãããã§ç§ã®ä¿³åªã¯äŸå€ãæããŠãåãããã çµå±ã®ãšããã圌ã¯ãµãŒããŒã®å¿çãæ£ãã解æã§ããŸããã§ããã ã€ã³ã¿ãŒãããã§ã¯ããã®ãšã©ãŒãšå¯èœãªè§£æ±ºçã«é¢ããæ å ±ã¯èŠã€ãããŸããã§ããã ãããŠå°ãèœã¡èŸŒãã ã ç§ã¯ãããã³ã«ã®ä»æ§ãå匷ããããã¯ã©ã€ã¢ã³ããæžãããããããšã«æéãè²»ãããããããŸããã§ããã ãããŠããã¶ãã¶ãæéãç¯çŽãããšããåç®ã§ãç§ã¯å®å šãªéåæã®æå³ãããã³ãŒã¹ããæ»ã£ãŠãåæJavaMailããããã³ã°ã©ã€ãã©ãªã䜿çšããããšã«ããŸããã ãã ããåãå Žæã§ãåãäŸå€ãé€ããŠããã®ã©ã€ãã©ãªã¯èœã¡ãŸããã ãã®åŸãçæ³ãæšãŠãããšã匱è«ãæ zyãªäººã ã®éã§ãããšåºã決å¿ããŸããããç§ã¯éåææ§ãšã¢ã¯ã¿ãŒã䜿ã£ãŠèªåã®IMAPã¯ã©ã€ã¢ã³ããäœæããŠããŸãã ããã«ãIMAPå šäœãå®è£ ããå¿ èŠã¯ãããŸããã§ãããæ©èœã¯éåžžã«å¶éãããŠããŸãããæ¿èªãINBOXãã©ã«ããŒã®éžæãã¡ãã»ãŒãžã®ãªã¹ãã®åä¿¡ãç¹å®ã®ã¡ãã»ãŒãžã®èªã¿åããã¡ãã»ãŒãžã®å¥ã®ãã©ã«ããŒãžã®ã³ããŒãåé€ã
äºåºŠç®ã®è©Šã¿
ç§ã¯ç¹ã«ã©ãããå§ããããéžæããå¿ èŠã¯ãããŸããã§ããã ãåãã®ããã«ãAkkaéçºè ã¯ããæç¹ã§ããããã¯ãŒã¯I / Oã®NettyãæŸæ£ããSprayãæ¯æããŸããã å°æ¥ãAkkaãšSprayã®éçºã¯éåžžã«å¯æ¥ã«çµ¡ã¿åã£ãŠããããããããã®ããã¥ã¡ã³ãã§ããçžäºã«åç §ãããspray.ioã®ã³ãŒãã¯akka.ioã«ã¹ã ãŒãºã«ç§»è¡ããŸããã ãããŠãããã§äž»ãªåé¡ã¯ç§ãåŸ ã£ãŠããŸããïŒãã€ãŠãããŒãžã§ã³2.xã®éçºäžã«ãAkkaã¯Sprayã§äœ¿çšããããã£ãã«ã®ã¢ã€ãã¢ãæ¡çšããŸããïŒãããã¯ããã€ãã©ã€ã³ãã§ããããè±èªã®ãã€ãã©ã€ã³ã§ãïŒãèè ã«ããã°ãèå§ããµããŒããããããã¯ãŒã¯ãããã³ã«ãäœæããã®ã¯ç°¡åã§ããã€ãŸããåä¿¡è ãéä¿¡è ããã®ããŒã¿ã¹ããªãŒã ãåŠçããã£ã«ã¿ãªã³ã°ãåé¢ãä¹ç®ããæéããªãå Žåã«ãã€ããè©°ãŸããªãããã«ããã«ããç· ãããæ©èœã§ãããããã§ãããªãã§ãã ããã ãããããããã®ããã€ãã©ã€ã³ãã®äœãããããããªããå®éšæ®µéãé¢ããããšãªããå»æ¢ããããšå®£èšãããŸããã AkkaããæåŸã«çºè¡šãããã€ãããŒã·ã§ã³ã¯ããã£ãã«ãå®å šã«çœ®ãæããããšãç®çãšããŠããŸãããããªã¢ã¯ãã£ãã¹ããªãŒã ãã¯æ¢ã«ããã§èšè¿°ãããŠããŸã ãããããã®é©æ°ã¯ãŸã çºè¡šæ®µéã«ãããããakka 2.3.6ã®ææ°ããŒãžã§ã³ã§ã¯ãŸã ãããŸãããããããã£ãã«ã¯ãããŸããã ãã£ã³ãã«ã¯ã¹ãã¬ãŒå ã«æ®ããŸãããããããã«é¢ãããã¹ãŠã®ããã¥ã¡ã³ãã¯å€ãAkkaããŒãžã§ã³2.2.0-RC1ããã¥ã¡ã³ãã«ã€ãªãããçŸåšã®ãã¹ãŠã®çŸå®ãåæ ããªããªããŸããã æ°ããAkkaã®ããã¥ã¡ã³ãã§ã¯ããã£ã³ãã«ã¯ã¹ãã¬ãŒã«ãšã©ãŸã£ãŠãããšæžãããŠããŸãã äžè¬ã«ãç§ã®ã¡ãŒã«ã¯ã©ã€ã¢ã³ãã®æåã®ããŒãžã§ã³ã¯ããã©ã³ã±ã³ã·ã¥ã¿ã€ã³ã®èŸæ±åŒ·ãåäŸãšã»ãŒåãã§ããããšãå€æããŸããã ç§ã¯ãã®æŠå¿µãéåžžã«è€éã§ããããã«æãããããããã«ããã€ãã©ã€ã³ããæŸæ£ããããšã«ããŸããããããã£ãŠãã¯ã©ã€ã¢ã³ãã¯ãµãŒããŒããã®æååãByteStringã®åœ¢åŒã§çŽæ¥æäœããŸããã ããæ£ç¢ºã«ã¯ããã®ã¹ããªãŒã ã®ãã©ã°ã¡ã³ãã䜿çšãããšãé¢å¿ã®ããåçã1ã€ã«ãŸãšãŸããã2ã€ã®åçãäžèŽããªãããšã誰ãä¿èšŒããªãããã§ãã å¥è·¡çãªæ¹æ³ã§ãå€æ°ã®ããã£ãªãããã¢ãã¿ãŒã«æ³šãããã³ãŒãã®äžéšãæžãçŽããããããããŸããŸãªå Žæã§èŠã€ãã£ãããã€ãã®ã³ãŒãã䜿çšããŠãã¢ã¯ã¿ãŒã«SSL / TLSæå·åããã蟌ãããšãã§ããŸããã å ¬åŒããã¥ã¡ã³ãã®å€ãã®ããŒãžã§ã³ã®äžéšïŒéåžžã«å€ãïŒã®ç¹å®ã®ã³ãŒãã®ã¿ã§èŠã€ãã£ãã³ãŒãã¯ãæ©èœããŸããã§ããã
ãã®æ§ãããªæ©èœã®åŸç¶ã®å段éã®å®è£ ã«ãããç§ã®ã¯ã©ã€ã¢ã³ãã¯ããæªãããªããŸããã çµå±ã次ã®ç¹°ãè¿ãã§ããåå3æã«ãç§ã¯ããªãããã®ããã«çããããšãã§ããªããªã£ãããšã«æ°ã¥ããŸãããåãããããã³ã°JavaMailãè©Šãããã«è¿·æããããŠTODOã«æžããŸããã
3åç®ã®è©Šã¿
ããããç¿æïŒãŸãã¯æŒé£æã«ïŒé åºãªã¹ã«ã ããã°ã§ãã£ããããJavaMailã䜿ãããªãããšãã代ããã«ãæåã«githubã®SprayãœãŒã¹ã«ã¢ã¯ã»ã¹ããŸããã æ°æ¥ãããŠããããç 究ããåãåã£ãæ å ±ãèªåã®ããŒãºã«åãããŠèª¿æŽããŸããããè²»ãããæéã¯èŠäºã«å ±ãããŸããã ãŸãããœãŒã¹ã³ãŒãã§ãããã¥ã¡ã³ãã®ä»ã®éšåã§èª¬æãããŠããªãConnectionHandlerã¯ã©ã¹ã«åºäŒããŸããã ã¹ãã¬ãŒçŒ¶ã§ãã®ã¯ã©ã¹ã®ã¢ããªã±ãŒã·ã§ã³ãç 究ããŠãããšãã«ããããã®ããã€ãã©ã€ã³ãã䜿çšããæ¹æ³ãšå Žæãç解ããŸãããããã¥ã¡ã³ãããã解決ããããã«åŒã³åºãããã¿ã¹ã¯ã ããèŠã€ããŸãããã ãããè¡ãæ¹æ³ã¯ããããŸããã§ããã åããœãŒã¹ã³ãŒãã§ããã€ãããæ¥ç¶ãããæ¹æ³ãã€ãŸãããã€ãã©ã€ã³ïŒPipelineStageïŒã®è€æ°ã®ããã€ããïŒã¹ããŒãžïŒã1ã€ã®å ±éã®ããã€ãã©ã€ã³ãã«çµåããæ¹æ³ãããããããããã®ã䜿çšæ¹æ³ãçºèŠããŸããã ãŸããç§ã¯åæ¥ã«SSLæå·åã倱æããçç±ãšæ¹æ³ãã©ã®ããã«æ©èœããããèŠã€ããŸããããã®ç¬éãŸã§ã¯ããããŸãæ©èœããç»ãå¿ èŠã¯ãããŸããããšãããã©ãã¯ããã¯ã¹ã®ãŸãŸã§ããã
åçº
詳现ã«èå³ããã人ã®ããã«ïŒããã€ãã©ã€ã³ãã¯ããŒãã§æ§æããããªãªãžãã«ã§ã¯ãã¹ããŒãžããŸãã¯ãã¹ããŒãžãïŒè±èªã®ã¹ããŒãžïŒãšåŒã°ããŸãããç»åãç¶æããããã«ããã€ãããšåŒã³ãŸãã ã³ãŒãå ã®ãããã®ããã€ããã¯>>æŒç®åã䜿çšããŠçµåãããé åºãéèŠã§ãã æåã¯ã¯ã©ã€ã¢ã³ãã«æãè¿ãããã€ããã§ãæåŸã¯ãµãŒããŒã«è¿ããã®ã§ãã ã€ãŸããã¯ã©ã€ã¢ã³ãããéä¿¡ããããã®ã¯ãã¹ãŠãããã€ãã©ã€ã³ããå·Šããå³ãžããµãŒããŒãã-éã«å³ããå·ŠãžãšééããŸãã ããšãã°ãæå·åãå®è¡ããããã€ããã¯æåŸã«ç€ºãããŸãããããã£ãŠãã¯ã©ã€ã¢ã³ããããã€ããã«éä¿¡ãããã®ã¯ãã¹ãŠå¿ èŠãªå€æããã¹ãŠçµãŠããæå·åãããæå·åãããããŒã¿ãæçµçã«ãµãŒããŒã«éä¿¡ãããŸãã ãŸããã®éã«ããµãŒããŒãéä¿¡ãããã¹ãŠã®ãã®ãæåã«åŸ©å·åããã次ã«ããã€ãã©ã€ã³ãã®æ®ãã«ãã£ãŠå€æãããŸãã ãªããã®é 管ããã¹ãŠå¿ èŠãªã®ã§ããïŒ ããŸããŸãªãã®ã«ã ããšãã°ãéä¿¡ãŸãã¯åä¿¡ãããããŒã¿ããã£ã«ã¿ãªã³ã°ããŸãã ãŸãã¯ãäžéšã®ãšã³ãã£ãã£ãä»ã®ãšã³ãã£ãã£ã«å€æããŸããããã¯ããããã³ã«ãå®è£ ãããšãã«åœ¹ç«ã¡ãŸãã ç¹å®ã®ã±ãŒã¹ã¯ã©ã¹DeleteMessageïŒidïŒStringïŒããããšããŸãã ã¯ã©ã€ã¢ã³ãã¯DeleteMessageïŒã23ãïŒã®ã€ã³ã¹ã¿ã³ã¹ãããã€ãã©ã€ã³ãã«éä¿¡ãã1ã€ã®æ®µéïŒããã€ããã®1ã€ïŒã§ãã®ã¯ã©ã¹ã¯ãµãŒããŒãç解ããã³ãã³ããa001 STORE 23 + FLAGS.SILENTïŒ\ DeletedïŒãã«å€æãããŸãã ããã§ããããšãã°ããµãŒããŒããã®å¿çãäžå®å šã§ãè¿œå ãäºæ³ãããå Žåãããã€ããã¯ããŒã¿ã®é ä¿¡ãé 延ãããå¯èœæ§ããããŸãã
æåã«ç§ãå®å šã«æ··ä¹±ãããäž»ãªç¹ã¯ããã€ãã³ãããšãã³ãã³ããã®æŠå¿µæŠå¿µã®ååšãšãããã«å¯Ÿå¿ãããã€ãã©ã€ã³ã®å èš³ãã€ãã³ããã€ãã©ã€ã³ãšã³ãã³ããã€ãã©ã€ã³1ã€ã®ã¯ã©ã¹ïŒPipelineStageã ã³ã³ã»ããã®æåã®æ®µéã§ç§ã«ç解ãããªãã£ãã®ã¯ãããã®äººã ã§ããïŒãŸããããã¥ã¢ã«ã¯æ£ãã°ã£ãŠããŠåããã«ãããæè ã ããæåŸãŸã§èªãã§ãæ®éã®äººã¯ããã«è¡ããã³ãŒã³ãåããŸãïŒç§ã¯ãã€ãã©ã€ã³ãæªããšæãããããå€ããããšæ±ºããŸããè€éã§æéãè²»ãã䟡å€ã¯ãããŸããã ããã¯ãããã¯ãã¬ãã·ã£ãŒããšäœããã®é¢ä¿ãããããã«æãããŸãããããã¯èæ ®ã«å ¥ããŠå®è£ ããå¿ èŠããããŸããããŸã£ããå¿ èŠãããŸããã§ããã ãããŠãããã¯ãæåã«1ã€ã®ããã€ããã貌ãä»ããå ŽæããŸãã¯ãµãŒããŒã«äœããå±ãããã«äœããå ¥ããæ¹æ³ãããããªãã£ããšããäºå®ã«å ããŠã ãããŠã圌女ããçããåŸãæ¹æ³ã ãããŠããããã®ãã€ããããã«2ã€ãããŸããã äžæ¹ããããã®èª€è§£ããªããã°ãç§ã®å°ããªæªç©ãçºæãããåŸã®ãé 管ãã¢ãããŒãã®åãååã«æããããšã¯ãªãã£ãã ããã å®éãã¢ã€ãã¢ã¯éåžžã«ã·ã³ãã«ã§ããããšãããããç§ãç¬ãããããšããã§ããŸãããã€ãã³ãã¯ãµãŒããŒããã¯ã©ã€ã¢ã³ãã«éããããã®ã§ãããã³ãã³ãã¯ã¯ã©ã€ã¢ã³ããããµãŒããŒã«éããããã®ã§ãã ãã®çµæããã€ãã¯1ã€ã§ããããšãå€æããŸããããã€ãã®å éšã§ã¯ããã€ãèªäœã2ã€ã®è¿ã¥ããŠãããããŒãåé¢ããŠãããããã©ãããæ¥ãã®ãæ··ä¹±ããªãããã«ãªã£ãŠããŸãã
çµæ
äžè¬ã«ãç§ã®ç 究ã®çµæãIMAPãµãŒããŒãžã®æ¥ç¶ãæ åœããæ°ããã¯ã©ã¹ãäœæããŸããã
class Connection(client: ActorRef, remoteAddress: InetSocketAddress, sslEncryption: Boolean, connectTimeout: Duration)(implicit sslEngineProvider: ClientSSLEngineProvider) extends ConnectionHandler { actor => override def supervisorStrategy = SupervisorStrategy.stoppingStrategy def tcp = IO(Tcp)(context.system) log.debug("Attempting connection to {}", remoteAddress) tcp ! Tcp.Connect(remoteAddress)//, timeout = Some(Duration(connectTimeout, TimeUnit.SECONDS))) context.setReceiveTimeout(connectTimeout) val pipeline = eventFrontend >> ResponseParsing() >> SslTlsSupport(512, publishSslSessionInfo = false) override def receive: Receive = { case connected: Tcp.Connected => val connection = sender() connection ! Tcp.Register(self, keepOpenOnPeerClosed = sslEncryption) client ! connected context.watch(connection) context.become(running(connection, pipeline, pipelineContext(connected))) case Tcp.CommandFailed(_: Tcp.Connect) => throw new ConnectionFailure(1, "Failed to connect to IMAP server") case ReceiveTimeout => log.warning("Connect timed out after {}", connectTimeout) throw new ConnectionFailure(2, "Connect timed out") } def eventFrontend = new PipelineStage { def apply(context: PipelineContext, commandPL: CPL, eventPL: EPL): Pipelines = new Pipelines { val commandPipeline: CPL = commandPL val eventPipeline: EPL = { case event => client ! event } } } def pipelineContext(connected: Tcp.Connected) = new SslTlsContext { def actorContext = context def remoteAddress = connected.remoteAddress def localAddress = connected.localAddress def log = actor.log def sslEngine = if (sslEncryption) sslEngineProvider(this) else None } }
ãã®ã¯ã©ã¹ã¯ãspray.can.client.HttpClientConnectionã¯ã©ã¹ãåçŽåããããšã§ååŸããŸããã ããã¯ãspray.io.ConnectionHandlerããç¶æ¿ãããããã¯akka.Actorããç¶æ¿ãããŸãã ã€ãŸãã圌ã¯æ®éã®ä¿³åªã§ãã å®éãããã¯é 管工ã§ãã圌ãã¹ã¿ãã¹ã©ããšåŒã³ãŸãããã ã¹ã¿ãã¹ã©ãã¯ãã¯ã©ã€ã¢ã³ããããµãŒããŒãžã®ãã€ãã©ã€ã³ãšããã®ãã€ãã©ã€ã³ãä»ããããŒã¿ã®ããåããæ åœããŠããŸãã æšæºã®context.actorOfïŒ...ïŒã§ã¢ã¯ã¿ãŒïŒã€ãŸãèªåïŒãåæåãããšãã«ããã®ãã€ãã©ã€ã³ãèè£ ããŸãã ãã€ãã©ã€ã³ããããã£ã¯ããã®å Žåã3ã€ã®ãã€ãïŒããã³ããšã³ãããµãŒããŒããã®å¿çããŒãµãŒãããã³SSL / TLSãšã³ã¯ãªãã¿ãŒïŒããçµã¿ç«ãŠããããã€ãã©ã€ã³ã§ãã ãããŠä»ãé 管工ã¹ã¿ãã¹ã©ãã«éä¿¡ããããã¹ãŠã®ããŒã¿ïŒåœŒãã俳åªãšããŠããªãã¬ãŒã¿ãŒã«ã¡ãã»ãŒãžãéä¿¡ããããšã«ãã£ãŠïŒãtellã¡ãœããããŸãã¯ä»ã®å©çšå¯èœãªæ段ã«ãã£ãŠïŒã圌ã¯ãããæ éã«ãã€ãã«å ¥ããŠãµãŒããŒã«éä¿¡ããŸãã ãŸãããµãŒããŒããã®å¿çã«å«ãŸãããã¹ãŠã®ãã®ããã€ãããæ éã«åãåºãããã¯ã©ã€ã¢ã³ãã«éä¿¡ãããŸãã 圌ã¯ç§ãã¡ã®å€åãªç·ã¹ã¿ã·ã¯ã§ãã
ç§ã䜿çšãããã€ãã«ã€ããŠã¯ã
SslTlsSupportã¯Sprayã®æšæºSSL / TLSæå·åæ©èœã§ãã ç¹å¥ãªã³ã³ããã¹ãïŒpipelineContextã¡ãœããã«ãã£ãŠè¿ãããïŒãå¿ èŠã§ãããŸãããµãŒããŒåŽã§æ¥ç¶ãéããåŸã§ããæ¥ç¶ã®ã¯ã©ã€ã¢ã³ãåŽãéãããŸãŸã«ããå¿ èŠããããŸãïŒããããã»ããªãŒãã³æ¥ç¶ïŒã
ResponseParsingã¯ãæ§æ解æãæ åœããããã€ããã®ã€ã³ã¹ã¿ã³ã¹ãè¿ãapplyïŒïŒé¢æ°ã䜿çšããŠæ¢ã«æžã蟌ãŸãããªããžã§ã¯ãã§ãããµãŒããŒããã®æåã¹ããªãŒã ãïŒãçã®ãTcp.Receivedã¡ãã»ãŒãžã®åœ¢ã§ïŒç¹å®ã®åçã®ã±ãŒã¹ã¯ã©ã¹ã«è§£æããåŠçããŸããã§ã«ã¿ãŒã²ããã¢ã¯ã¿ãŒïŒç§ã®IMAPã¯ã©ã€ã¢ã³ãïŒã ããŒãµãŒã¯ãè¿ãããããŒã¿ã®æŽåæ§ãç£èŠãã圹å²ãæãããŸãããµãŒããŒããã®å¿çãå®äºããŠããªãå Žåã¯è¿œå ããŒã¿ãåŸ æ©ãããããã1ã€ã«ãªã£ãå Žåã¯è€æ°ã®å¿çãäºãã«åé¢ããŸãã ããã«ãããã¯ã©ã€ã¢ã³ãã®ã³ãŒããå€§å¹ ã«ã¢ã³ããŒããããŸãããã¯ã©ã€ã¢ã³ãã¯ãã²ã©ããããã¯ãŒã¯ã¢ã³ã¹ã¿ãŒãããã·ã³ãã«ã§ãããããããçŽæ¥çã§è€éã§ãªãç·Vasilyã«å€ãããŸããã Vasinaã®ããã©ãŒãã³ã¹ãç¶æããããã«å¿ èŠãªãã¹ãã®éãå€§å¹ ã«åæžãããŸããã
æåŸã«ã eventFrontendã¯ãããã€ããã®ã€ã³ã¹ã¿ã³ã¹ãè¿ãé¢æ°ã§ã-PipelineStage ããã®æ¬è³ªã¯1ã€ã§ãããã¹ãŠã®ãã€ãã³ããïŒã€ãŸãããµãŒããŒãããã€ãã©ã€ã³å šäœãééãããã§ã«å¿ èŠãªãã¹ãŠã®å€æŽãè¡ãããããŒã¿ïŒãã¯ã©ã€ã¢ã³ããã€ãŸãVasyaã«éä¿¡ããŸããã¯ã©ã¹ã³ã³ã¹ãã©ã¯ã¿ãŒã«æž¡ãããå€æ°ã®ãããã§ãã¹ã¿ãã¹ã©ããç¥ã£ãŠããã¢ãã¬ã¹ã
ãã®ãããªå¿ èŠæ§ããªããããã³ãã³ãã®ç¹å¥ãªã¬ã³ããªã³ã°ã¯è¡ããŸããã§ããã ãµãŒããŒãžã®ãã¹ãŠã®ã³ãã³ãã¯ãåçŽãªTcp.Writeã䜿çšããŠéä¿¡ãããŸãã
ãšãããŒã°
ããã§ãå®éã«ã¯ããã¹ãŠã®é 管ã ãšãããŒã°ãšããŠãã¯ã©ã€ã¢ã³ãèªäœã¯Akka.FSMã«åºã¥ãæéç¶æ ãã·ã³ã§ãããšèšããŸãã 圌ã®ããã«ãªãŒãããã³ãšãŠããããã¹ããæžãã®ã¯ãšãŠããšããµã€ãã£ã³ã°ãªããã²ãŒã ã§ãããããç§ã¯Akkaã§ã®ãã®ã³ã³ã»ããã®å®è£ ã«å€¢äžã«ãªããŸããã