Editing
Actor Model
(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!
=== Key Concepts === ==== Actors ==== An actor is the fundamental unit of computation in the Actor Model. Actors have a unique identity and can be conceptualized as individual entities that receive and process messages in a concurrent system. In Elixir, actors are represented by **processes** and created using the `spawn` function. ==== Message Passing ==== Actors communicate with each other by sending and receiving messages asynchronously. When sending a message, actors do not block and continue with their processing. Messages can contain any kind of data, including other actors, which allows for hierarchical and recursive structures. In Elixir, message passing is achieved through the `send` and `receive` functions. ==== State and Behavior ==== Each actor has its own internal state and behavior. The state represents the current values of the actor's variables, while the behavior consists of the actor's response to incoming messages. Actors can change their state only by processing received messages, ensuring that state changes are controlled and serialized. In Elixir, actors manage their state using immutable data structures and pattern matching. ==== Supervision ==== Supervision is a powerful feature of the Actor Model that enables fault-tolerance and error handling. Actors can supervise other actors, ensuring that they are automatically restarted in case of failures. This hierarchical supervision structure allows for creating robust systems capable of recovering from errors. In Elixir, supervision trees are defined using the `Supervisor` module.
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