spullara/mustache.java — Issue #13: Switch threads executor service for Akka
Author: agentgt
Created: 2012-01-13 02:44:36+00:00
State: open

I noticed that the author did something I did a couple of years go where you make parts of the template load asynchronously.
Granted I did this by customizing velocity but I too used the ExecutorService, ConcurrentHashMaps and custom Future objects)

While this seems like a good idea it is a bad idea for a web site. One of the drawback with Java Servlet containers are the sheer number of threads you are going to use. Also thread context switching is not cheap.

So you might want to take a look at Akka http://akka.io/ which supposedly fixes this issue with event driven actor architecture and cooperative threads (supposedly).