A general purpose queue'ing mechanism using promises