Robert Jaros
07/01/2024, 12:31 PMsend and sendAndAwaitCompletion? Is using the latter somehow less performant?Casey Brooks
07/13/2024, 2:10 AMsend basically just puts the Input into the `InputStrategy`’s Channel, and it only suspends in response to the Channel’s buffer (if configured to suspend). vm.send and vm.trySend correspond directly to the underlying channel.send and channel.trySend.
sendAndAwaitCompletion is actually aware of how the Input will be processed by the VM, and will suspend until the Input has been fully processed. It’s used in the Test module to run Inputs in sequence, only dispatching one Input after the previous one has completed so that nothing gets dropped from the Channel. You might use this API if you wanted to automate a sequence of actions in your VM, such as demonstrating the screen’s functionality in an onboarding flow, especially if which inputs to send depend on the VM state.