Bluebird.js: How to add wait for each iteration of Promise.map?

Viewed 5426

I am processing an array using Promise.map. For each element I am performing an async operation which returns a promise. However, I want to introduce some delay between each call because the downstream has a limit on the number of requests. Here is what I want to do

return Promise.map(array, function (elem){
    // perform an async call using elem
    // wait for 500 ms
})

How can I achieve the same ?

3 Answers
Related