3 ms·
That's a strange criticism of futures to make, because the great strength of them is that you should be able to think about them sequentially, and then as long
by chrisseaton 11y ago
That's a strange criticism of futures to make, because the great strength of them is that you should be able to think about them sequentially, and then as long as they do not have conflicting side effects that model will hold to a concurrent implementation.
- hyperpape 11y agoAgreed. 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.