r/javascript • • 7d ago

Remote procedure calls for interactive applications

https://willybrauner.com/journal/remote-procedure-calls-for-interactive-applications
7 Upvotes

4 comments sorted by

1

u/Ronin-s_Spirit 4d ago

You wrote a whole article on it? It's nothing more than just awaiting a fetch, but you put the fetch behind a function so it's clean and easy to use.

1

u/chriscastro2409 2d ago

The tricky part is timeout handling: a server may commit before the response is lost, so retries can duplicate work.

•

u/juarez_isabel7 5h ago

For writes, give each operation an idempotency key so a retry can return the prior outcome instead of applying the mutation twice. A timeout alone cannot tell the client whether it committed.

0

u/Discordbothost 6d ago

A disconnect can hide a successful LED update. Try cutting the socket right after an update, then read the board state on reconnect before replaying commands. Repeating a toggle can undo the first call.