@schimmy this comment is slightly inaccurate--the waiting happens as long as the above (`@socket.bufferSize > 0 or @work_in_progress`) is true, so it's really "wait until work is complete and all data is written to gearmand"