Skip to content

Conversation

diwu-arete
Copy link
Contributor

cache and update to Firebase Segmentation backend. CL also contains unit
tests.
(The http client is not implemented yet.)
@googlebot googlebot added the cla: yes Override cla label Jun 26, 2019
@diwu-arete diwu-arete requested a review from shrutip90 June 26, 2019 20:24
@diwu-arete diwu-arete self-assigned this Jun 26, 2019
Copy link
Member

@vkryachko vkryachko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, given your limited needs in terms of http, I'd strongly suggest you consider using HttpUrlConnection instead of okhttp

@diwu-arete diwu-arete requested a review from vkryachko July 9, 2019 17:58
@diwu-arete
Copy link
Contributor Author

Changed okhttpclient to httpsUrlConnection

@diwu-arete diwu-arete requested a review from vkryachko July 18, 2019 19:05
private final SegmentationServiceClient backendServiceClient;
private final Executor executor;

FirebaseSegmentation(FirebaseApp firebaseApp) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this constructor delegate to the one below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

}
TaskCompletionSource<Void> taskCompletionSource = new TaskCompletionSource<>();

executor.execute(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 points:

  • There is a dedicated Tasks.call(executor, callable) to achieve this effect
  • Consider extracting the lambda below into its own (private) method that you can annotate with @WorkerThread

This applies to the here and throughout as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good learning!
Done

@diwu-arete diwu-arete requested a review from vkryachko July 22, 2019 18:44
@diwu-arete diwu-arete merged commit d07ec25 into floc-master Jul 22, 2019
@firebase firebase locked and limited conversation to collaborators Oct 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants