LearnBoost/socket.io-client — pull request #421 by gabehollombe (2012-04-23 11:05:55+00:00)
Title: Adding support for manual buffer flushing

In response to https://github.com/LearnBoost/socket.io-client/issues/305 and because we needed it here at work, too, I've added two new things:

- a new 'auto flush' option that defaults to true, preserving the existing functionality

- a new flushBuffer() public method that can be called if you'd like to manually flush the buffer after a reconnect (assuming you set 'auto flush' to false, this is how you'd flush the buffer when you're ready to)

I tried my best adding some tests which you'll see in one of the commits, but I'm not sure if they're good enough. They test the happy paths, but they don't test the case where the buffered message isn't received until flushBuffer() is called because i'm not sure how to test that. Thoughts?