actor - What other stuff can a Scala message tell you? -
given scala code below:
actor1
actor2 ! 'some_message
actor2
receive (or react) { case 'some_message sender ! 'ok_message
what info sender (actor1) can actor2 ?
how can tell actor message came if more 1 actor can send same message actor2 ? there metadata in sender can queried ?
am newcomer scala. patience.
...ken r
you can send actor sent original message part of message.
actor1
actor2 ! ("message", self)
actor2
receive (or react) { case (string: string, sender: actor) => { sender ! "another message" } }
it should noted, though, should use send message original sender. calling function directly on actor cause sorts of terrible things happen!
i read in programming in scala today, if want more it, highly recommend book.
Comments
Post a Comment