Editing
Message Passing
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Overview == In Elixir, message passing is achieved through the '''Actor model'''. An actor is an independent entity, represented by a process, that can receive and send messages to other actors. Each actor has its own mailbox, which stores incoming messages until they are processed. To send a message to another actor, the '''send/2''' function is used. The first argument is the recipient's process identifier (PID), and the second argument is the message itself. The recipient can handle the message using pattern matching in a receive block, where it can define different cases for different message patterns. The '''receive/1''' function is used to match and process incoming messages. It takes a list of message patterns and their corresponding actions. Once a message matches a pattern, the corresponding action is executed. If no matching pattern is found, the process suspends until a matching message arrives.
Summary:
Please note that all contributions to Elixir Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Elixir Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information