BewareMyPower commented on code in PR #157:
URL: https://github.com/apache/pulsar-client-cpp/pull/157#discussion_r1073574213
##########
lib/HTTPLookupService.cc:
##########
@@ -409,4 +430,72 @@ void
HTTPLookupService::handleLookupHTTPRequest(LookupPromise promise, const std
}
}
+void HTTPLookupService::handleGetSchemaHTTPRequest(GetSchemaPromise promise,
const std::string completeUrl) {
+ std::string responseData;
+ Result result = sendHTTPRequest(completeUrl, responseData);
+
+ if (result == ResultNotFound) {
+ promise.setValue(boost::none);
Review Comment:
If the `ResultNotFound` is only used internally, it should not be exposed to
users. `ResultRetryable`, which was added by me, is a bad example but I cannot
think of a better way because of the deeply coupling code. IMO, it would be
acceptable to remove `ResultRetryable` from the enum if there was a better way
to achieve the same goal.
`sendHTTPRequest` is a private method of `HTTPLookupService`, we can return
the `long` response code instead of the `Result`. Then, we can map the response
code to a `Result` when the code is not 404.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]