Rogach
Rogach

Reputation: 27250

Problems with Scala actors

Why this does not work?

scala> actor { loop { receive {
     | case s:String => s + " :)"
     | }}}
res0: scala.actors.Actor = scala.actors.Actor$$anon$1@2d382988

scala> res0 !? "hello"
... and it hangs here ...

Upvotes: 1

Views: 138

Answers (1)

Thomas Rawyler
Thomas Rawyler

Reputation: 1095

Try reacting to the given message:

actor { loop { receive {
        case s: String => reply(s + " :)")
      }}}

Upvotes: 6

Related Questions