eclipse/vert.x — pull request #792 by ddimensia (2014-02-12 05:27:39+00:00)
Title: Partial implementation to address the pause/order problem.

This is an attempted fix for the issue discovered with the pause/resume implementation in DefaultHttpClientResponse. A similar fix would need to be applied to the 'resume' method of the DefaultNetSocket class.

This change causes new buffers to be added to the end of the paused queue until it is completely processed. The task used to process the paused queue handles a hardcoded number of chunks at a time to try and prevent consuming too much time in the task. Eventually the paused queue will be empty and end will be called if pending or data will flow to the data/end handlers directly.

This could probably be implemented other ways but it is important to make sure that buffers (and end) are always handled in the correct order.