I have a code which is using for-comprehension to run database query :
val totalFeeNoticeAmountFromDB = Future(/..Doing db job../)(executionContext)
val listOfRestrictedFundFromDB = Future(/..Doing db job../)(executionContext)
val res = for {
totalFeeNoticeAmount <- totalFeeNoticeAmountFromDB
listOfRestrictedFund <- listOfRestrictedFundFromDB
} yield (totalFeeNoticeAmount, listOfRestrictedFund)
We know for running for-comprehension we need to pass implicit execution context.
But in this case I am wanting to pass execution context manually.
What is the way ?
Edited:
val res = for {
totalFeeNoticeAmount <-(?:ExecutionContext) totalFeeNoticeAmountFromDB
listOfRestrictedFund <-(?:ExecutionContext) listOfRestrictedFundFromDB
} yield (totalFeeNoticeAmount, listOfRestrictedFund)
totalFeeNoticeAmountFromDB
and listOfRestrictedFundFromDB
are both Future type already initiated.
Is there any way of passing here
<-(?:ExecutionContext)
?