Skip to content

Commit

Permalink
Update 2018-12-20-frame-processing.md
Browse files Browse the repository at this point in the history
  • Loading branch information
natario1 authored Aug 29, 2019
1 parent eddae18 commit c8d03ee
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/_posts/2018-12-20-frame-processing.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ public void process(@NonNull Frame frame) {
// EXAMPLE 1:
// Firebase and Google APIs will often return a Task.
// You can use Tasks.await() to complete the task on the current thread.
Tasks.await(firebaseDetector.detectInImage(firebaseImage));
// Read: https://developers.google.com/android/guides/tasks#blocking
try {
result = Tasks.await(firebaseDetector.detectInImage(firebaseImage));
catch (Exception e) {
// Firebase task failed.
}


// EXAMPLE 2:
// For other async consumers, you can use, for example, a CountDownLatch.
Expand Down

0 comments on commit c8d03ee

Please sign in to comment.