3 ms·
Agreed. There's a basic level of thread safety that any server code needs to meet[1]: there aren't global variables or objects shared between requests that are
by hyperpape 11y ago
Agreed. There's a basic level of thread safety that any server code needs to meet[1]: there aren't global variables or objects shared between requests that are modified in unsafe ways. Once you have that, futures are often pretty easy to reason about.
You do have to make sure you're being careful what you pass into your futures--perhaps using immutable objects or defensive copies. It's not trivial, but it's not horrible either.
[1] Yeah, I know there are cases where people use separate processes each running single-threaded, but c'mon.