-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/rpc alignment #21
Feature/rpc alignment #21
Conversation
MelamudMichael
commented
Mar 17, 2024
•
edited
Loading
edited
- Using uattributes from protobuf
- Aligning invokeMethod to up-core 1.5.7
- Added invokeMethod with Cb
- Added unit-tests for RPC client
Remove the init/term functions in favor of using the constructor and destructor for the sub classes, and use a shared_ptr to do the reference counting. Signed-off-by: Bill Pittman <william.1.pittman@gm.com>
Signed-off-by: Bill Pittman <william.1.pittman@gm.com>
uprotocol::v1::UStatus invokeMethod(const uprotocol::v1::UUri &topic, | ||
const uprotocol::utransport::UPayload &payload, | ||
const uprotocol::v1::CallOptions &options, | ||
const uprotocol::utransport::UListener &callback) noexcept; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would need to be updated if UListener is changed to replace functors with lambdas. See my comment on the up-cpp PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not going to be handled part of this release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MelamudMichael if something is not going to be resolved, add a link to the issue that will be used to track the change.
Signed-off-by: Bill Pittman <william.1.pittman@gm.com>
Feature/up client zenoh
return handle; | ||
} else { | ||
return nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@billpittman add print
|
||
handle = std::make_shared<upZenohClient>(ConstructToken()); | ||
if (handle->rpcSuccess_.code() == UCode::OK && handle->uSuccess_.code() == UCode::OK) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@billpittman please rename uSucess to uTransportSuccess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@billpittman please add brackets around each condition
UStatus status; | ||
if (UCode::OK != ZenohSessionManager::instance().init(config)) { | ||
spdlog::error("zenohSessionManager::instance().init() failed"); | ||
rpcSuccess_.set_code(UCode::UNAVAILABLE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@billpittman instead of setting the code in each failure, set it to failure by default in the beginning of the function
} | ||
ZenohRpcClient::~ZenohRpcClient() noexcept { | ||
if (UCode::OK != ZenohSessionManager::instance().term()) { | ||
spdlog::error("zenohSessionManager::instance().term() failed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@billpittman do return in case of failure
|
||
if (0 == refCount_) { | ||
spdlog::error("ZenohRpcClient is not initialized"); | ||
return future; | ||
} | ||
|
||
if (false == isRPCMethod(uri.resource())) { | ||
if (false == isRPCMethod(topic.resource())) { | ||
spdlog::error("URI is not of RPC type"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* get queue size | ||
* @return queue size | ||
*/ | ||
size_t getQueueSize() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* get the number of max concurrent request | ||
* @return number of concurrent requests | ||
*/ | ||
size_t getMaxConcurrentRequests() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see comments
uprotocol::v1::UStatus invokeMethod(const uprotocol::v1::UUri &topic, | ||
const uprotocol::utransport::UPayload &payload, | ||
const uprotocol::v1::CallOptions &options, | ||
const uprotocol::utransport::UListener &callback) noexcept; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MelamudMichael if something is not going to be resolved, add a link to the issue that will be used to track the change.
* get the number of max concurrent request | ||
* @return number of concurrent requests | ||
*/ | ||
size_t getMaxConcurrentRequests() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MelamudMichael, could we not just fail if the max concurrent requests fail? I'm worried this is adding complexity to the app developer that they do not need.
* get queue size | ||
* @return queue size | ||
*/ | ||
size_t getQueueSize() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MelamudMichael if you expose this logic to the app developer, they need to maintain a list/queue of requests as well, I don't think we should do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging for now, open items will be addressed later.