impl(rest): add completion queue and thread types with no grpc deps#16078
impl(rest): add completion queue and thread types with no grpc deps#16078scotthart merged 1 commit intogoogleapis:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces "pure REST" implementations for background threads and completion queues to decouple the REST library from gRPC dependencies. It refactors RestCompletionQueueImpl to use these new components and moves RunAsyncBase to a dedicated header. Feedback recommends adding a joinable check before joining threads in the background thread pool and removing an unused std::enable_shared_from_this inheritance to simplify the RestPureCompletionQueueImpl class.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #16078 +/- ##
==========================================
- Coverage 92.69% 92.67% -0.02%
==========================================
Files 2343 2348 +5
Lines 217439 217492 +53
==========================================
+ Hits 201547 201555 +8
- Misses 15892 15937 +45 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jinseopkim0
left a comment
There was a problem hiding this comment.
Would it make sense to add unit tests?
|
The implementation for PureRestCompletionQueue* was ported over from RestCompletionQueue* and then RestCompletionQueue* is implemented using PureRestCompletionQueue*. So, the existing unit tests for RestCompletionQueue* are testing PureRestCompletionQueue*. |
Upcoming OAuth features require timers and background processing. The existing REST completion queue and background thread types still depend on gRPC types from the original CompletionQueue making them unsuitable. If we had known a few years ago we'd need this, it would have been done differently then.
This PR adds the needed "pure" REST versions of background threads and completion queue. moves RunAsyncBase to its own file in the common library, and implements RestCompletionQueueImpl using the new RestPureCompletionQueueImpl which is still based on TimerQueue.
Hopefully we can reconcile these various types in the future and reduce the need for all the varieties.