Actor: An independent unit of computation with private state, a mailbox, and behaviour describing how it reacts to messages. An actor is an independent unit in a concurrent program. It has its own private state, a mailbox for incoming messages, and rules for how it reacts to each message. Nothing outside can touch its state directly.
Actors communicate only by sending messages. An actor can process one message at a time, update its own state, send messages to other actors, or create new ones.
What should you keep in mind with Actor?
Because no two actors share memory, many classic concurrency problems simply do not arise. There are no locks to forget and no data changed by two threads at once. Erlang and Elixir are built around this idea, as are Akka on the JVM and Microsoft Orleans. In PHP and JavaScript you rarely write actors directly, but queue workers that each handle one job at a time follow a similar way of thinking.
Use when code runs things at the same time - threads, async/await, queues and workers, parallel requests, cron jobs, webhooks that retry - or when a bug only happens "sometimes" or under load. Covers race conditions, deadlocks, mutexes/locks, atomic operations, idempotency, message queues and backpressure, with Laravel and database examples.
Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.