# How to do chain requests in series and parallel?

**URL:** <https://discuss.emberjs.com/t/how-to-do-chain-requests-in-series-and-parallel/2932>\
**Category:** Design\
**Created:** [October 10, 2013, 1:55pm UTC](https://discuss.emberjs.com/t/how-to-do-chain-requests-in-series-and-parallel/2932 "2013-10-10T13:55:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarasm](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/tarasm/32/15980_2.png) [@tarasm](https://discuss.emberjs.com/u/tarasm)\
**Post date:** [October 10, 2013, 1:55pm UTC](https://discuss.emberjs.com/t/how-to-do-chain-requests-in-series-and-parallel/2932/1 "2013-10-10T13:55:45Z")

</div>

Continuing the discussion from [Guide: When and how to handle asynchronous side-effects in testing?](http://discuss.emberjs.com/t/guide-when-and-how-to-handle-asynchronous-side-effects-in-testing/2905/6):

> [@Guide: Asynchronous side-effects in testing](https://discuss.emberjs.com/t/guide-asynchronous-side-effects-in-testing/2905/6):
>
> Hey guys… I am using normal Em.$.ajax() in my app using return Em.$.ajax(…).then(), but I started to look some presentations and materials talking about RSVP and promises. What is the best way to ensure that multiples requests follow a sequence and the second request wait to start when the first request ends? Sometimes I need to do two or more dependents Ajax requests.

Briefly, you want to look at [Ember.RSVP.all()](https://github.com/tildeio/rsvp.js#arrays-of-promises), [Ember.RSVP.hash()](https://github.com/tildeio/rsvp.js#hash-of-promises) and remember that when you return a promise from another promise’s callback, it will be resolved before the entire chain is resolved.

Stefan Penner does a great job of [explaining Promises in September Boston Meetup](http://www.youtube.com/watch?v=g5CSaK3HqVA&feature=youtu.be).
