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

    https://github.com/apache/nifi-minifi-cpp/pull/107#discussion_r118830048
  
    --- Diff: libminifi/include/ConfigurationListener.h ---
    @@ -0,0 +1,121 @@
    +/**
    + * ConfigurationListener class declaration
    + *
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +#ifndef __CONFIGURATION_LISTENER__
    +#define __CONFIGURATION_LISTENER__
    +
    +#include <memory>
    +#include <atomic>
    +#include <cstdint>
    +#include <cstring>
    +#include <iostream>
    +#include <string>
    +#include <thread>
    +
    +#include "yaml-cpp/yaml.h"
    +#include "core/Core.h"
    +#include "core/Property.h"
    +#include "properties/Configure.h"
    +#include "core/logging/Logger.h"
    +
    +namespace org {
    +namespace apache {
    +namespace nifi {
    +namespace minifi {
    +// Forwarder declaration
    +class FlowController;
    +// ConfigurationListener Class
    +class ConfigurationListener {
    +public:
    +
    +  // Constructor
    +  /*!
    +   * Create a new processor
    +   */
    +  ConfigurationListener(FlowController *controller,
    +      std::shared_ptr<Configure> configure, std::string type) :
    +      connect_timeout_(20000), read_timeout_(20000), type_(type), 
configure_(
    +          configure), controller_(controller), 
need_client_certificate_(false) {
    +    logger_ = logging::Logger::getLogger();
    +    running_ = false;
    +  }
    +  // Destructor
    +  virtual ~ConfigurationListener() {
    +    stop();
    +  }
    +
    +  // Start the thread
    +  void start();
    +  // Stop the thread
    +  void stop();
    +  // whether the thread is enable
    +  bool isRunning() {
    +    return running_;
    +  }
    +  // pull the new configuration from the remote host
    +  virtual bool pullConfiguration(std::string &configuration) {
    +    return false;
    +  }
    +
    +protected:
    +
    +  // Run function for the thread
    +  void run();
    +
    +  // Run function for the thread
    +  void threadExecutor() {
    +    run();
    +  }
    +
    +  // Mutex for protection
    +  std::mutex mutex_;
    +  // thread
    +  std::thread thread_;
    +  // whether the thread is running
    +  bool running_;
    --- End diff --
    
    ^ i'm worried about cache coherency here.


---
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