def FetchCompletedRequests(self, session_id, timestamp=None):
    subject = session_id.Add("state")
    requests = {}
    status = {}

    if timestamp is None:
      timestamp = (0, self.frozen_timestamp or rdfvalue.RDFDatetime().Now())

    for predicate, serialized, _ in self.data_store.ResolvePrefix(
        subject, [self.FLOW_REQUEST_PREFIX, self.FLOW_STATUS_PREFIX],
        token=self.token, limit=self.request_limit, timestamp=timestamp):

      parts = predicate.split(":", 3)
      request_id = parts[2]
      if parts[1] == "status":
        status[request_id] = serialized
      else:
        requests[request_id] = serialized

    for request_id, serialized in sorted(requests.items()):
      if request_id in status:
        yield (rdf_flows.RequestState(serialized),
               rdf_flows.GrrMessage(status[request_id]))
Tells the Chromecast to quit current app_id.
dataset/ETHPy150Open google/grr/grr/lib/queue_manager.py/QueueManager.FetchCompletedRequests--crossover with--dataset/ETHPy150Open balloob/pychromecast/pychromecast/__init__.py/Chromecast.quit_app