Akka in Scala, exclamation mark and question mark

ticofab picture ticofab · Jul 15, 2013 · Viewed 25.3k times · Source

What is the difference between exclamation mark (!) and question mark (?) when sending messages to Actors?

myActor ! Hello(value1)
myActor ? Hello(value1)

Answer

om-nom-nom picture om-nom-nom · Jul 15, 2013

Shamelessly copied [awesome] official doc (look Send messages section for more):

Messages are sent to an Actor through one of the following methods.

! means “fire-and-forget”, e.g. send a message asynchronously and return immediately. Also known as tell.

? sends a message asynchronously and returns a Future representing a possible reply. Also known as ask.