Skip to content

Commit

Permalink
SERVER-1790 WIP: use initLazy but still in separate thread
Browse files Browse the repository at this point in the history
  • Loading branch information
RedBeard0531 committed May 31, 2011
1 parent 51701b5 commit 8a2bdb8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion client/parallel.cpp
Expand Up @@ -576,7 +576,16 @@ namespace mongo {
conn = myconn->get();
}

res->_ok = conn->runCommand( res->_db , res->_cmd , res->_res );
res->_cursor.reset( new DBClientCursor(conn, res->_db + ".$cmd", res->_cmd, -1/*limit*/, 0, NULL, 0, 0));
res->_cursor->initLazy();
//TODO: return here and resume later

bool finished = res->_cursor->initLazyFinish();
uassert(14812, str::stream() << "Error running command on server: " << res->_server, finished);
massert(14813, "Command returned nothing", res->_cursor->more());

res->_res = res->_cursor->nextSafe();
res->_ok = res->_res["ok"].trueValue();

if ( myconn )
myconn->done();
Expand Down
1 change: 1 addition & 0 deletions client/parallel.h
Expand Up @@ -288,6 +288,7 @@ namespace mongo {
DBClientBase * _conn;

scoped_ptr<boost::thread> _thr;
scoped_ptr<DBClientCursor> _cursor;

BSONObj _res;
bool _ok;
Expand Down

0 comments on commit 8a2bdb8

Please sign in to comment.