Conversation
…add examples for singleton hubs with different HubOptions
Kybxd
commented
Jul 15, 2025
| const std::shared_ptr<Messager> GetMessager(const std::string& name) const; | ||
| std::shared_ptr<MessagerContainer> GetProvidedMessagerContainer() const { | ||
| if (options_ != nullptr && options_->provider != nullptr) { | ||
| return options_->provider(); |
Collaborator
Author
There was a problem hiding this comment.
Should we also check the nilness of options_->provider()?
Member
There was a problem hiding this comment.
Nope, the provider should guarantee that returned MessagerContainer MUST not be nil.
So we may add comment to the MessagerProvider: // Must return non-nil MessagerContainer.
wenchy
requested changes
Jul 16, 2025
wenchy
requested changes
Jul 18, 2025
| auto options = std::make_shared<tableau::HubOptions>(); | ||
| options->filter = DefaultFilter; | ||
| options->provider = DefaultMessagerContainerProvider; | ||
| tableau::Hub::InitOnce(options); |
Member
There was a problem hiding this comment.
Clarify, please add comment: // call base hub's InitOnce
Comment on lines
+40
to
+41
| // InitOnce sets the hub's options. | ||
| void InitOnce(std::shared_ptr<const HubOptions> options); |
Member
There was a problem hiding this comment.
Improve comment to:
// InitOnce inits the hub only once, and the subsequent calls will not take effect.
wenchy
approved these changes
Jul 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HubOptions&LoadOptionsHubOptionstableau::Registry::Initonce when initializingHubGetMessagerContainerWithProviderin perf(cpp)(BREAKING)!: encapsulate messager container to improve messager access performance #95❗BREAKING CHANGE
The plugin
protoc-gen-cpp-tableau-loaderfunctionLoadchanged frombool Load(const std::string& dir, Format fmt = Format::kJSON, const LoadOptions* options = nullptr);tobool Load(const std::string& dir, Format fmt = Format::kJSON, std::shared_ptr<const LoadOptions> options = nullptr);Compatibility resolution
optiontype from pointer to shared_ptr.Hub::Initchanged toHub::InitOnce