Showing posts with label actors. Show all posts
Showing posts with label actors. Show all posts

Friday, December 7, 2007

I love Scala Actors

One of my favorite things about Scala is it's Actor library.

Messaging has become an important part of modern architecture for the web. Many of the large scale web sites that are popular today are using message queues as infrastructure for processing requests. Scala Actors help us use those ideas in lift. Recently we added AMQP support to lift by wrapping RabbitMQ's client libraries with Scala Actors. Scala Actors make it easy to model the consumer/producer paradigm that's so prevalent in modern messaging systems.

Another thing I love about Scala Actors is combining them with my favorite functional combinators to make useful data structures. Recently, for lift, I wrote some example code that I felt could benefit from a cache. 30 lines of Actors and functional combinators later and I had a full-featured cache where listeners could register and be updated when the state of the cache changed.

Actors are a wonderful tool for software design. If you want to learn more about them, I recommend reading the Scala Actors papers.