I can see that scala can solve the Producer-Consumer problem using actors. There is a couple of examples on the web but what is worrying me is the unlimited growth of an actor's mailbox.
Suppose the producer produces on a much faster rate than the consumer can consume. Using the traditional synchronized threads approach, I can set up a buffer size and if the buffer is full, I can ask the producer to wait. The scala Actor Model approaches that I have seen so far use the mailbox as a "buffer". But what if a consumer receives too many messages from the producer? The mailbox will keep growing and eventually the program will crash? Can actors specify mailbox size limit or is there some other elegant way of dealing with this in scala?