Example #1
0
    bool ClientCursor::yield( int micros , Record * recordToLoad ) {
        // some cursors (geo@oct2011) don't support yielding
        if (!_c->supportYields())  { return true; }

        YieldData data;
        prepareToYield( data );
        staticYield( micros , _ns , recordToLoad );
        return ClientCursor::recoverFromYield( data );
    }
Example #2
0
    bool ClientCursor::yield( int micros ) {
        if ( ! _c->supportYields() )
            return true;
        YieldData data;
        prepareToYield( data );

        staticYield( micros , _ns );

        return ClientCursor::recoverFromYield( data );
    }
Example #3
0
 void QueryPlanSet::Runner::mayYield() {
     if ( _plans._mayYield ) {
         if ( _plans._yieldSometimesTracker.ping() ) {
             int micros = ClientCursor::yieldSuggest();
             if ( micros > 0 ) {
                 if ( !prepareToYield() ) {
                     return;   
                 }
                 ClientCursor::staticYield( micros , _plans._ns );
                 recoverFromYield();
             }
         }
     }
 }
Example #4
0
 void QueryPlanSet::Runner::mayYield( const vector< shared_ptr< QueryOp > > &ops ) {
     if ( _plans._mayYield ) {
         if ( _plans._yieldSometimesTracker.ping() ) {
             int micros = ClientCursor::yieldSuggest();
             if ( micros > 0 ) {
                 for( vector<shared_ptr<QueryOp> >::const_iterator i = ops.begin(); i != ops.end(); ++i ) {
                     if ( !prepareToYield( **i ) ) {
                         return;
                     }
                 }
                 ClientCursor::staticYield( micros , _plans._ns );
                 for( vector<shared_ptr<QueryOp> >::const_iterator i = ops.begin(); i != ops.end(); ++i ) {
                     recoverFromYield( **i );
                 }
             }
         }
     }
 }