Adam Powell
07/28/2019, 7:12 PMCompletableDeferred
to be a better option for just a single value thoughCLOVIS
07/28/2019, 7:21 PMAdam Powell
07/28/2019, 7:29 PMclass Request<I, R>(val id: I) {
val result: CompletableDeferred<R>()
}
val ch = Channel<Request<I, R>>()
with a send-request looking something like val req = Request(id)
ch.send(req)
val result = req.result.await()
and then the receiver does req.result.complete(fetchedValue)
Adam Powell
07/28/2019, 7:32 PMCLOVIS
07/28/2019, 7:37 PM