gaocegege
V2EX  ›  Scala

有什么方法,能够使得主程序在 Actor 执行了 exit 后才继续执行么~?

  •  
  •   gaocegege · Jun 10, 2015 · 7437 views
    This topic created in 4000 days ago, the information mentioned may be changed or developed.
    举个例子



    这里的"???"总是在ping和pongexit前就输出了,有什么办法能够使得程序在所有的Actor结束后,再执行么~
    Supplement 1  ·  Jun 11, 2015
    8 replies    2015-06-11 18:07:11 +08:00
    hepin1989
        1
    hepin1989  
       Jun 10, 2015
    scala的actor都废弃了
    gaocegege
        2
    gaocegege  
    OP
       Jun 10, 2015
    @hepin1989 ...好忧伤,刚入坑就被告知了这么残酷的事实
    Numbcoder
        3
    Numbcoder  
       Jun 10, 2015
    Erlang 中是可以的,Scala 不知道。

    Scala 的 actor 没废弃把,现在叫 Akka 把
    gaocegege
        4
    gaocegege  
    OP
       Jun 10, 2015
    @Numbcoder scala的actor和Akka的actor是两种实现,不一样哎~
    LPeJuN6lLsS9
        5
    LPeJuN6lLsS9  
       Jun 11, 2015
    竟然过时了……正在看的《快学Scala》里,continuations不再随2.12发布就感觉很惊讶,没想到actors也过时了。这边至少还会为了兼容附带上吧?
    gaocegege
        6
    gaocegege  
    OP
       Jun 11, 2015
    @hantsuki 都有2.12了吗?我更加过时了。。至于actors,要是没有的话怎样多线程呢?
    LPeJuN6lLsS9
        7
    LPeJuN6lLsS9  
       Jun 11, 2015
    @gaocegege 那是未来的计划啦。为什么不能用多线程?最起码Java的那套库都可以用
    gaocegege
        8
    gaocegege  
    OP
       Jun 11, 2015
    @hantsuki 哦,那就只有java的那一套理论了,用起来很累啊~
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2971 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 02:25 · PVG 10:25 · LAX 19:25 · JFK 22:25
    ♥ Do have faith in what you're doing.