Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I’m really confused why this is an “async queue.” Seems pretty synchronous to me since requests are completed in order, one at a time. I literally wrote something to do this in the past few months. This was to work around JavaScript’s asynchronous IO making a shit show of updates from library being used in the client. I had to queue requests in JavaScript, have them execute in order (FIFO), and explicitly described it “synchronous.”

Is it only “async” because it’s doing it in JavaScript and the underlying network request API is asynchronous? Seems like, IMHO, a really bad way to describe the desired result since all IO in JavaScript is going to be async by default.



the async part isnt very exciting, but its the callback after the entry has been through the queue and worked on.

its certainly serialized, but nothing fancy otherwise.

it would be synchronous if you blocked the requester until the request go through the queue and then completed. you wouldnt need to introduce an async/await.

you can see examples in JS on the node FS functions. the defualt ones are async, but they have some magic wrappers that make it actually sychronous and block the event loop from running until the file is loaded




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: