Created
November 4, 2016 10:07
-
-
Save ScalaWilliam/0388226ecb2a3b041a8437f35e2be520 to your computer and use it in GitHub Desktop.
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
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