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 |
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
val fa = callToRemoteServiceA(); | |
val fb = callToRemoteServiceB(); | |
val fc = callToRemoteServiceC(fa.get()); | |
val fd = callToRemoteServiceD(fb.get()); | |
val fe = callToRemoteServiceE(fb.get()); | |
val executor = new ThreadPoolExecutor(4, 4, 1, TimeUnit.MINUTES, new LinkedBlockingQueue[Runnable]()) |
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
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> |