This file contains 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
import java.io.{FileInputStream, BufferedInputStream} | |
import scala.io.Source | |
import scala.xml.pull.{XMLEventReader, EvElemStart, EvElemEnd, EvText} | |
object GutenbergCrunch | |
{ | |
private def parseBook( parser : XMLEventReader ) : (String, String, String) = |
This file contains 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
import play.api.Logger | |
import org.slf4j.MDC | |
+import scala.concurrent.{ExecutionContext, Future} | |
import java.util.UUID | |
+import java.util.concurrent.Executors | |
-object SyncController extends Controller { | |
- def syncEndpoint(profileId: Long) = Action(parse.json) { req => | |
+object AsyncController extends Controller { | |
+ implicit val ec = ExecutionContext.fromExecutor(Executors.newFixedThreadPool(2)) | |
+ // For this example, ensure the threads in the pool are already created |