This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object ReadSample extends App { | |
| /** | |
| * The readable trait defines how objects can be converted from a string | |
| * representation to the objects instance. For most of the standard types | |
| * we can simply use the toType function of String. | |
| */ | |
| trait Readable[T] { | |
| def read(x: String): T | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class BigPipeServlet extends HttpServlet { | |
| private static ExecutorService executor = Executors.newFixedThreadPool(500, new ThreadFactory() { | |
| public Thread newThread(Runnable r) { | |
| Thread t = new Thread(r); | |
| t.setName("Service Thread "+ t.getId()); | |
| t.setDaemon(true); | |
| return t; | |
| } | |
| }); |