Messages and Message Handlers
Before you create a message, you need to understand what a Message is, and the relationship it has with its Handler, or message handler.
Message anatomy
Let’s start by looking closely at messages. The messages that a Flash might put in an inbox (its own inbox or that of another Flash) are not supportive notes, like "You run very fast, Flash." They are tasks that need to be handled.
A message is an instance of Message and contains several fields. Three are relevant to your implementation:
what | a user-defined int that describes the message |
obj | a user-specified object to be sent with the message |
target | the Handler that will handle the message |
The target of a Message is an instance of Handler. You can think of the name ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access