Github user phrocker commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/114#discussion_r123503771
  
    --- Diff: libminifi/src/RemoteProcessorGroupPort.cpp ---
    @@ -54,19 +57,29 @@ bool create = true) {
       std::unique_ptr<Site2SiteClientProtocol> nextProtocol = nullptr;
       if (!available_protocols_.try_dequeue(nextProtocol)) {
         if (create) {
    +      refreshPeerList();
           // create
    -      nextProtocol = std::unique_ptr<Site2SiteClientProtocol>(new 
Site2SiteClientProtocol(nullptr));
    -      nextProtocol->setPortId(protocol_uuid_);
    -      std::unique_ptr<org::apache::nifi::minifi::io::DataStream> str = 
std::unique_ptr<org::apache::nifi::minifi::io::DataStream>(stream_factory_->createSocket(host_,
 port_));
    -      std::unique_ptr<Site2SitePeer> peer_ = 
std::unique_ptr<Site2SitePeer>(new Site2SitePeer(std::move(str), host_, port_));
    -      nextProtocol->setPeer(std::move(peer_));
    +      for (auto peer : site2site_peer_status_list_) {
    --- End diff --
    
    Could you not create one on demand and simply return it versus enqueueing 
it and dequeuing it? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to