Category Archives: Asynchronous JavaScript

Bringing async/await to life in JavaScript

My dream has come true this week. I can now write clean asynchronous code in JavaScript: no callbacks, no intrusive control flow library, no ugly preprocessor. Just plain JavaScript! This is made possible by a new feature of JavaScript called … Continue reading

Posted in Asynchronous JavaScript, Uncategorized | 42 Comments

Harmony Generators in streamline.js

Harmony generators have landed in a node.js fork this week. I couldn’t resist, I had to give them a try. Getting started If you want to try them, that’s easy. First, build and install node from Andy Wingo’s fork: $ … Continue reading

Posted in Asynchronous JavaScript, Uncategorized | Leave a comment

Node.js stream API: events or callbacks?

Last year, I wrote a blog post about events and node streams. In this post, I proposed an alternative API for streams: callback-oriented rather than event-oriented. For readable streams, the proposal was to have a simple read(cb) call, where cb … Continue reading

Posted in Asynchronous JavaScript, Uncategorized | 6 Comments

node.js for the rest of us

Simple things should be simple. Complex things should be possible. Alan Kay I published streamline.js 18 months ago but did not write a tutorial. I just took the time to do it. The tutorial implements a simple search aggregator application. … Continue reading

Posted in Asynchronous JavaScript, Uncategorized | 3 Comments

Asynchronous JavaScript with Generators – An Experiment

I have recently added a third blade to my little asynchronous programming swiss army knife: the generator blade. Looks sharp! Here are some details. Generators Generators are JavaScript’s flavor of coroutines. They solve one of computer science’s most important problems: … Continue reading

Posted in Asynchronous JavaScript, Uncategorized | 5 Comments

Fibers and Threads in node.js – what for?

I like node.js, and I’m not the only one, obviously! I like it primarily for two things: it is simple and it is very fast. I already said it many times but one more won’t hurt. Before working with node, … Continue reading

Posted in Asynchronous JavaScript, Uncategorized | 54 Comments

Yield – Resume vs. Asynchronous Callbacks – An Equivalence

I introduced streamline.js about four months ago and I never took the time to explain the theory (if it can be called a theory) behind it. I’ll try to do it in this post. The material that follows is a … Continue reading

Posted in Asynchronous JavaScript, Uncategorized | 19 Comments