mongodb/mongo-cxx-driver — pull request #97 by TylerBrock (2014-06-13 15:39:54+00:00)
Title: CXX-188 Add parallel scan helper

I have some comments in the code but essentially the implementation works as follows:

- The connection used to call the parallel scan method is used to initiate the scan by sending the `parallelCollectionScan` command to the server.
- The method then checks out/creates new connections for each cursorId returned and constructs a cursor using those connections for use by the caller.
- The additional connections are retrieved from the connection pool using the same hostname and socketTimeout as the connection that was used to invoke the method.
- The caller is responsible for cleaning up the Cursors after consuming their results.
- In a Cursor's destructor it checks the connection it used back into the pool for future use.