3 ms·
How does hn define sync/async comms? Me personally I think it has a lot to do with attention, at the risk of abusing a buzz word in vogue since the dawn of the
by gchamonlive 3y ago
How does hn define sync/async comms?
Me personally I think it has a lot to do with attention, at the risk of abusing a buzz word in vogue since the dawn of the transformer. But as long as attention must be continuous somewhere in your system, you have sync comm. When you can decide when to give attention to something, making attention brittle, you have async.
- bruce511 3y agoI can't speak for all of HN, but I can speak for me. I maintain a library for a language that does network comms. All the calls are simply passed to another background thread, and the code in the calling thread keeps going. In other words all the commands are non blocking. That's for outgoing. For incoming a message is sent to the originating thread (actually to the originating object on the originating thread) and the object can the process the incoming at their convenience. For me this is async. The request and the response are disconnected in the running code. You might request here, but the response appears over there. It's easier to understand on the server side. There the object is just chilling, and suddenly a message arrives out of nowhere to alert to an incoming packet. Sync comms "blocks" the program until the reply arrives. This could take milliseconds, or minutes, depending on what you are asking for. Which means your program is unresponsive in this time.