logoalt Hacker News

kazinatorlast Friday at 10:55 PM0 repliesview on HN

I mean that it's possible in the sense of being designed in as a guarantee; that the async operations issued against some API object will be performed in the order in which they are submitted, like a FIFO queue.

I don't mean "promise.then", whereby the issuance of the next request is gated on the completion of the first.

An example might be async writes to a file. If we write "abc" at the start of the file in one request and "123" starting at the second byte in the second requests, there can be a guarantee that the result will be "a123", and not "abc2", without gating on the first request completing before starting the other.

async doesn't mean out of order; it means the request initiator doesn't synchronize on the completion as a single operation.