Tell sends a message to an Akka actor through its ActorRef. It is commonly written with the bang operator, `!`: `myActorReference ! 1` sends the integer `1` to that actor address. The sender continues rather than waiting for a reply; whether a reply is needed is part of the receiving actor’s protocol. section 2.2.3 section 12.1.3
myActorReference ! 1
Use `!` to send a value matching the actor’s message type. section 2.2.3
An actor’s declared message type constrains tell at compile time. An `ActorSystem[Int]` accepts integer messages, so sending `1` and `10` compiles; attempting to send an `Int` to an actor whose protocol does not accept it fails compilation. This also exposes stale callers when a protocol changes during refactoring. section 2.2.3
Sending to a wallet
A minimal application creates a typed wallet actor and sends two messages: `guardian ! 1` followed by `guardian ! 10`. The actor processes its protocol one message at a time, returning a next behavior for each processed message. Protocols can therefore represent state either through stored values or through different behaviors. section 2.2.3 section 2.6
Tell suits a command whose work can proceed independently of an immediate result. In a betting flow, the bet actor tells a wallet to reserve funds and supplies a response adapter, which turns the wallet’s eventual response into an internal message. This avoids chaining nested questions and their combined timeout decisions. By contrast, a time-sensitive market-state check uses `ask` with an explicit timeout because it requires an answer. section 12.1.3 section 12.1.3
Use tell when designing actor communication:
- Send only messages included in the target actor’s typed protocol. section 2.2.3
- Model a reply, if required later, in the protocol through an ActorRef or an adapter rather than blocking the sender. section 12.1.3
- Prefer it for independent commands; use an answer-oriented interaction when subsequent logic requires a bounded response. section 12.1.3
