title: How to fetching data with gRPC but not make the app delay?
body: <p>I'm trying to call gRPC when using camera preview with camera plugin. I call gRPC to fetch data from server every 2 second but it make my camera preview on screen stop about 0,5 second because it can not reload if my data not return yet.</p>
  
  <p>I trying to use compute to make that function run in other isolate but it show this error: </p>
  
  <blockquote>
    <p>Unhandled Exception: Invalid argument(s): Illegal argument in isolate message : (object is a closure - Function '_handleBuildScheduled@870399801':.)</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>if (DateTime.now().difference(lastMarkTime).inSeconds &gt;= 2){
      var person = await compute(sendFaceImage, [_faces, service, context]);
  
      if (person == 'unknown') {
        setState(() {
          unknownPerson = true;
        });
      }
       lastMarkTime = DateTime.now();
    }
  
  static Future&lt;String&gt; sendFaceImage(List&lt;dynamic&gt; values) async {
  if (values[0].isNotEmpty) {
    List&lt;List&lt;int&gt;&gt; images = List&lt;List&lt;int&gt;&gt;();
    images.add(imglib.encodeJpg(cropImage));
    var deviceID = App.localStorage.get('DeviceID');
    try {
      final response = await values[1].sendFace(
          listImageToListFaceRecImage(images, trackID), deviceID, 1);
      response.first.then((value) {
        print(value.result);
        Map&lt;String, dynamic&gt; result =
            (jsonDecode(value.result) as List&lt;dynamic&gt;)[0];
        personCode = result['person_code'];
        if ((personCode != 'unknown') &amp;&amp; (personCode != '')) {
          Navigator.pushReplacement(
              values[2],
              MaterialPageRoute(
                  builder: (context) =&gt; ResultFaceDetectScreen(
                      personCode: personCode,
                      captureImage:
                          Image.memory(imglib.encodeJpg(cropImage)))));
        }
      });
    } catch (e) {}
  }
  return personCode;
  </code></pre>
  
  <p>}</p>
  
  <p>It seems like compute function not work with async/await because it still work with the function not have async/await.</p>