Begin fetching.
 Will run synchronous fetches first and async fetches afterwards.
 Updates progress when each module finishes its fetch.
180358
def fetch
      requests = instantiate_modules.select(&:fetch?).map(&:requests).flatten

      total, done = requests.size, 0
      update_progress(total, done)

      before_fetch

      backend.new(requests).run do
        update_progress(total, done += 1)
      end

      after_fetch

      true
    rescue => e
      error(e)
      raise e
    end
896009
def run_until_complete(self) -> None:
        ''''''

        Log.debug('running event loop until all tasks completed')
        self.terminate_on_finish = True
        asyncio.ensure_future(self.init())
        self.loop.run_forever()
        self.loop.close()
205377
private function syncDataInternal()
    {
        Console::startProgress(0, $this->getOffsetTotal(), 'Fetch: ' . $this->getName() . ' ');
        $this->_contentRowsCount = 0;

        $dataChunk = [];
        for ($i = 0; $i < $this->getOffsetTotal(); ++$i) {
            $requestData = $this->request($i);

            if (!$requestData) {
                continue;
            }

            if (0 === $i % $this->build->syncRequestsCount) {
                $inserted = $this->insertData($dataChunk);
                $this->_contentRowsCount += $inserted;
                $dataChunk = [];
            }

            Console::updateProgress($i + 1, $this->getOffsetTotal());

            $dataChunk = array_merge($requestData, $dataChunk);
            gc_collect_cycles();
        }

        if (!empty($dataChunk)) {
            $this->insertData($dataChunk);
        }

        Console::endProgress();
    }
1148842
def async_fetch_in_batch(handles, batch_size = 1000, &block)
      raise "No block given for the batch fetch request!" unless block_given?
      # Can't get data from an unfinished query
      unless async_is_complete?(handles)
        raise "Can't perform fetch on a query in state: #{async_state(handles)}"
      end

      # Now let's iterate over the results
      loop do
        rows = fetch_rows(prepare_operation_handle(handles), :next, batch_size)
        break if rows.empty?
        yield rows
      end
    end
663111
async function start() {
  if (child) {
    await stop();
  }

  return new Promise((resolve) => {
    const serverPath = path.resolve(process.cwd(), 'packages/node_modules/@webex/test-helper-server');

    child = spawn(process.argv[0], [serverPath], {
      env: process.env,
      stdio: ['ignore', 'pipe', process.stderr]
    });

    child.stdout.on('data', (data) => {
      const message = `${data}`;
      const pattern = /.+/gi;

      if (message.match(pattern)) {
        resolve();
      }
    });

    process.on('exit', stop);
  });
}
940113
async def first(self):
        
        if self._metadata is None:
            self._non_result()
        try:
            return (await self.fetchone())
        finally:
            await self.close()
1362498
def sync_fetch(request, method, default_headers=None,
               httpclient=None, **kwargs):
    
    updated_request = make_request(request, method, default_headers, **kwargs)
    if not httpclient:
        httpclient = HTTPClient()
    rsp = httpclient.fetch(updated_request)
    return parse_response(rsp)
282459
private static void apiReady() {

        loadingApi = false;
        for (Command callback : onApiReady) {
            callback.execute();
        }
        onApiReady.clear();
    }
1086134
def process(self, results):
        
        for node_key, data in results:
            request = self.requests.get(node_key)
            if request is None:
                # This may happen if we resend a request for a node after waiting too long,
                # and then eventually get two responses with it.
                self.logger.info(
                    "No SyncRequest found for %s, maybe we got more than one response for it"
                    % encode_hex(node_key))
                return

            if request.data is not None:
                raise SyncRequestAlreadyProcessed("%s has been processed already" % request)

            request.data = data
            if request.is_raw:
                self.commit(request)
                continue

            references, leaves = self.get_children(request)

            for depth, ref in references:
                self.schedule(ref, request, depth, request.leaf_callback)

            if request.leaf_callback is not None:
                for leaf in leaves:
                    request.leaf_callback(leaf, request)

            if request.dependencies == 0:
                self.commit(request)
288762
def async_fetch(handles, max_rows = 100)
      # Can't get data from an unfinished query
      unless async_is_complete?(handles)
        raise "Can't perform fetch on a query in state: #{async_state(handles)}"
      end
      
      # Fetch and
      fetch_rows(prepare_operation_handle(handles), :first, max_rows)
    end
1219390
function makeTask(fetch, deferred) {
  return function start(props, promises, match) {
    var promise = fetch(props, promises, match);

    if (promise.isFulfilled()) {
      deferred.resolve(promise.value());
      return promise;
    } else {
      return promise.then(
        (result) => {
          deferred.resolve(result);
          return result;
        },
        (err) => {
          deferred.reject(err);
          throw err;
        }
      );
    }
  };
}
167565
async function loadModulesConfig()
{
    if(!modulesLoaded)
    {
		for (let i = 0; i < modules.length; i++) {
			await applyBotDataSource(modules[i]);
        }
        
        modulesLoaded = true;
    }
}
1217321
def fetch(self, wait=0):
        
        if self.started:
            return fetch(self.id, wait=wait, cached=self.cached)
558017
private void startFetch() {
    prepareConcurrentMultiGetTasks();

    // set the time of starting
    fetch_start_time = System.currentTimeMillis();
    if (LOG.isDebugEnabled()) {
      LOG.debug("Start to fetch data using multiget, there will be " + multi_get_wait_cnt
          + " multigets to call");
    }

    for (int con_idx = 0; con_idx < concurrency_multi_get; ++con_idx) {
      final List<MultiGetTask> con_mul_get_tasks = multi_get_tasks.get(con_idx);
      final int task_index = multi_get_indexs.get(con_idx).incrementAndGet();

      if (task_index < con_mul_get_tasks.size()) {
        final MultiGetTask task = con_mul_get_tasks.get(task_index);
        final MulGetCB mgcb = new MulGetCB(con_idx, task.getTSUIDs(), task.getGets());
        mgcb.fetch();
      }
    } // end for
  }
136730
function()
			{
				var func = todo.shift();
				if (!func)
				{
					// all done!
					if (callback) callback(false);
					return;
				}

				if (token_fetch.indexOf(func.func) >= 0)
				{
					// if we're actually calling a token fetch function, skip!
					process.nextTick(step);
				}
				else
				{
					func.func(function(error) {
						if (error)
						{
							// token fetching error!
							if (callback) callback(func.name + " :: " + error);
							return;
						}

						// do next step
						process.nextTick(step);
					});
				}
			}
267220
def run(self):
        
        if self.update_time_value():
            self.i3status.py3_wrapper.notify_update(self.module_name)
        due_time = self.py3.time_in(sync_to=self.time_delta)

        self.i3status.py3_wrapper.timeout_queue_add(self, due_time)
675575
def run(self):
        
        for task in self.get_next_tasks(None):
            self.executor.add_task(task, None)
        while not self.executor.is_done():
            done_task_and_result = self.executor.wait_for_tasks()
            for task, task_result in done_task_and_result:
                self._add_sub_tasks_to_executor(task, task_result)