2 ms·
The use of actors with mailboxes that annoys the author is: 1. Take a message from the mailbox (that may have been queued for a long time). 2. If the mailbox
by jongraehl 17y ago
The use of actors with mailboxes that annoys the author is:
1. Take a message from the mailbox (that may have been queued for a long time).
2. If the mailbox still has more than N items, then throw away the message.
This is a really dumb way to approximate a fixed size mailbox, and doesn't allow for an immediate refusal.
The questionable Scala code is pulled from recently written O'Reilly book on Scala. I haven't read it myself, but it's probably not as good as "Programming in Scala" (Odersky et al), which covers Actors+Concurrency in Chapter 30.
Needless to say, Scala also has access to all the Java concurrency primitives and libraries. I believe there's a Scala STM library as well.
- michaelneale 17y agoYes I like the look of the clojure one, but actors are just one of many (flawed) libraries in Scala, I am sure a similar solution could work there.