Skip to content

Instantly share code, notes, and snippets.

@ScalaWilliam
Created November 4, 2016 10:07
Show Gist options
  • Save ScalaWilliam/0388226ecb2a3b041a8437f35e2be520 to your computer and use it in GitHub Desktop.
Save ScalaWilliam/0388226ecb2a3b041a8437f35e2be520 to your computer and use it in GitHub Desktop.
class ComplexFeature(serviceA: ServiceA, serviceB: ServiceB,
advancedFeature: AdvancedFeature)
extends Feature {
def execute(inputXml: Elem): Future[Result] = {
Future(ComplexFeature.process(serviceA, serviceB))
.recoverWith {
case NonFatal(e) => advancedFeature.execute(inputXml)
}
}
}
object ComplexFeature {
def process(serviceA: ServiceA, serviceB: ServiceB):
Future[Result] = ???
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment