DELAPARRA
Index
Color
NL
Category: Programming paradigms

Mailbox

Explained by Updated

What is Mailbox?

Mailbox: A queue of incoming messages an actor processes one at a time, so its own state never needs locks. In the actor model, a mailbox is the queue of incoming messages for one actor. The actor takes messages from its mailbox one at a time and handles each fully before starting the next.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about Mailbox

How is Mailbox used in practice?

Because only the actor itself touches its state, and only one message at a time, there are no race conditions inside an actor and no need for locks.

What should you keep in mind with Mailbox?

The mailbox can also become a bottleneck. If messages arrive faster than the actor can process them, the mailbox grows and memory use climbs. Monitoring mailbox size, limiting it, or adding more actors to share the work are the usual answers. A queue worker processing jobs one by one follows the same idea, which is why queue length is such an important metric to watch.

At a glance

CategoryProgramming paradigms
Explained by
Updated

More Programming paradigms terms

All terms starting with M

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.