Wrote a queue which waits for the next chunk in order.