Can Actors in Scala fail to process messages? (example in O'Reilly's Programming Scala)

后端 未结 4 609
无人共我
无人共我 2020-12-18 11:15

I\'m completely new to Scala, and I\'ve been working my way through Programming Scala (O\'Reilly) online; while doing so, I was surprised by the result of the

4条回答
  •  猫巷女王i
    2020-12-18 11:25

    Simple solution, add this to the end of shapes-actor-script.scala:

    Thread.sleep(1000)
    

    It'll give the actor time to print all the various Shape messages before the REPL terminates.

提交回复
热议问题