Sync vs Async

Yes, the server is asynchronous even though the handlers are synchronous. If the server and handlers are both synchronous, only one request can be handled at a time.

I’ve been thinking about where along the way the computer world conflated synchronous and sequential. One explanation might be that “at the same time” means “without giving up the CPU”. Another might be the definition of the adverb, synchronously, which can mean to do something at a known interval. The known interval being “when the previous instruction finishes”. I could see “the code runs synchronously, ergo it’s synchronous code”.

I’m not sure it’s relevant to this discussion, but I’ll mention that I think the futures in Java, which Clojure inherited, are pointless. They’re syntactic sugar around thread locking and a condition variable. Especially given that one of Clojure’s founding principles is to minimize or eliminate thread locks, it seems odd that futures got included.

The continuation based versions, like promises, make more sense to me. No thread locking. no additional context switching. That seems to fit better with how Clojure does things.