Asynchronous method queue chaining in JavaScript | Programming with style |

The post shows how the principle of cascading messages/fluent interfaces/method chaining (however one might call this) can be extended to work even with asynchronous methods. Basic idea is to use a queue that takes the chained commands and does all the synchronization work. Implementation is in Javascript but as a pattern this is valid for all languages that support function types.