title: Firebase Firestore retrieve data Synchronously/without callbacks
body: <p>I am using Cloud Firestore in a separate thread in my Android app, so I don't want to use listeners <code>OnSuccessListener</code> and <code>OnFailureListener</code> to run in yet another thread. Can I just make my thread wait for the result (and catch any exceptions if needed)?</p>
  
  <p>Currently the code for querying is something like this:</p>
  
  <pre><code>FirebaseFirestore.getInstance().collection("someCollection").get().addOnSuccessListener(new OnSuccessListener&lt;QuerySnapshot&gt;() {
      @Override
      public void onSuccess(QuerySnapshot documentSnapshots) {
           // do something on the UI thread with the retrieved data
           }
      });
  </code></pre>
  
  <p>What I'd like to have:</p>
  
  <pre><code>FirebaseFirestore.getInstance().collection("someCollection").getAndWaitForResult();
  //Block the thread and wait for result, no callbacks. 
  //getAndWaitForResult() is not a real function, just something to describe my intention.
  </code></pre>
  
  <p>I used to work with Parse Server before, and it was quite trivial there.</p>