You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Or return a promiseList. We can then use the get or wait to block if we need the results of the event to proceed for certain business logic.
example use need
class CostService implements EventPublisher {
Long sumWithTax(List<Long> nums) {
Long result =nums.sum()
AtomicLong taxTotal = new AtomicLong(0)
sendAndReceive("calcTaxes", result){ Long tax ->
taxTotal.addAndGet(tax)
}.get() //assuming it returns a promisList
return result + taxTotal.get()
}
}
Would it be better to add a new method instead of the sendAndReceive? Maybe call it notifyPromise?
The text was updated successfully, but these errors were encountered:
Or return a promiseList. We can then use the get or wait to block if we need the results of the event to proceed for certain business logic.
example use need
Would it be better to add a new method instead of the sendAndReceive? Maybe call it notifyPromise?
The text was updated successfully, but these errors were encountered: