Re:You Can Throw() Anything in JavaScript – and Other Async/...
by anonymoushn on Friday April 08, 2022 @11:15AM
(#30958180)
It doesn't limit you to a single in-memory representation of each entry in a remote database.
[ Parent
| on HN ]
Re:You Can Throw() Anything in JavaScript – and Other Async/...
by laurencerowe on Friday April 08, 2022 @01:02PM
(#30959681)
> It doesn't limit you to a single in-memory representation of each entry in a remote database.
If you have a remote database then you likely have multiple processes at play. For safety in those cases you need to rely on transactional safety at the database level or if transactions are not available then you may want to use a tool like TLA+ to check your distributed algorithm.
Re:You Can Throw() Anything in JavaScript – and Other Async/...
by anonymoushn on Saturday April 09, 2022 @03:04AM
(#30965818)
The example clearly has that though, otherwise it would not need
yield from server.update_balances([payer, payee])
Re:You Can Throw() Anything in JavaScript – and Other Async/...
by laurencerowe on Friday April 08, 2022 @12:31PM
(#30959224)
(The above comment was changed. When I replied it was talking about different threads reading from a database.)
In that case you’d be relying on the database rather than the programming language to manage shared state. (The article is more about how to safely manage shared state within a process.)