Improved module name <functional-area>-<Command|Query>....
Standalone services now use the Event Store Server (many tests still use the embedded server)
This commit is contained in:
10
scala-spring/common-web/build.gradle
Normal file
10
scala-spring/common-web/build.gradle
Normal file
@@ -0,0 +1,10 @@
|
||||
apply plugin: 'scala'
|
||||
|
||||
dependencies {
|
||||
compile "org.scala-lang:scala-library:2.10.2"
|
||||
compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion"
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package net.chrisrichardson.eventstore.examples.bank.web.util
|
||||
|
||||
import org.springframework.web.context.request.async.DeferredResult
|
||||
|
||||
import scala.concurrent.ExecutionContext.Implicits.global
|
||||
import scala.concurrent.Future
|
||||
|
||||
object WebUtil {
|
||||
def toDeferredResult[T](future: Future[T]): DeferredResult[T] = {
|
||||
val result = new DeferredResult[T]
|
||||
future onSuccess {
|
||||
case r => result.setResult(r)
|
||||
}
|
||||
future onFailure {
|
||||
case t => result.setErrorResult(t)
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user