Curious, what are the main UX hits to not implementing async? And are they mainly in play if there's a long wait for the user to approve on their end? (Not so much in play if just an extra second or so of latency?)

Replies (1)

The UI is on it's own thread and shouldn't be getting blocked, but there are probably some statements in there where it thinks it's making a quick function call but due to a bug that function is not returning. If I didn't implement async in the main code, then everything would be on the same thread, using a single CPU core, and all activity would be linearized... I'd have to wait for one relay to respond before I could ask the next relay. So async is vital in general. If just the signer wasn't async for its NIP-46 part, all operations like sign, encrypt and decrypt would block until the nip-46 relay replied, and that would slow things way down, but the UI wouldn't freeze.