Hello. I'm using a custom interceptor and want to ...
# ballast
r
Hello. I'm using a custom interceptor and want to send back an Input to the view model. I'm using
sendToQueue(Queued.HandleInput(null, MyContract.MyInput(...)))
. Is this correct? What is the first parameter of
HandleInput
-
val deferred: CompletableDeferred<Unit>?
. Is passing
null
ok?
c
Yes, you can safely pass
null
in the Queued.
sendToQueue()
only suspends if the channel's buffer is full, but the Deferred will suspend and only be completed once the Input has been fully processed (once the InputHandler has returned). It is equivalent to the difference between
vm.send()
and
vm.sendAndAwaitCompletion()
thank you color 1