szaszm commented on code in PR #1826:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1826#discussion_r1808685350


##########
extensions/civetweb/processors/ListenHTTP.h:
##########
@@ -39,15 +39,21 @@
 #include "utils/gsl.h"
 #include "utils/Export.h"
 #include "utils/RegexUtils.h"
+#include "core/FlowFileStore.h"
+
+namespace org::apache::nifi::minifi::test {
+struct ListenHTTPTestAccessor;
+}  // namespace org::apache::nifi::minifi::test
 
 namespace org::apache::nifi::minifi::processors {
 
 class ListenHTTP : public core::Processor {
  private:
-  static constexpr std::string_view DEFAULT_BUFFER_SIZE_STR = "20000";
+  static constexpr std::string_view DEFAULT_BUFFER_SIZE_STR = "5";
+  static const core::Relationship Self;

Review Comment:
   ```suggestion
     static constexpr core::RelationshipDefinition Self{"__self__", "Marks the 
FlowFile to be owned by this processor"};
   ```



##########
extensions/civetweb/processors/ListenHTTP.h:
##########
@@ -141,18 +147,39 @@ class ListenHTTP : public core::Processor {
   void onSchedule(core::ProcessContext& context, core::ProcessSessionFactory& 
session_factory) override;
   std::string getPort() const;
   bool isSecure() const;
+  void restore(const std::shared_ptr<core::FlowFile>& flowFile) override;
+
+  bool isWorkAvailable() override {
+    return handler_ ? !handler_->empty() : false;
+  }
+
+  std::set<core::Connectable*> getOutGoingConnections(const std::string 
&relationship) override;
 
   struct ResponseBody {
     std::string uri;
     std::string mime_type;
-    std::vector<std::byte> body;
+    std::shared_ptr<core::FlowFile> flow_file;
   };
 
   // HTTP request handler
   class Handler : public CivetHandler {
    public:
+    enum class FailureReason {
+      PROCESSOR_SHUTDOWN
+    };
+    struct RequestValue {
+      std::reference_wrapper<core::ProcessSession> session;
+      std::promise<void> ret;
+    };
+    struct FailureValue {
+      FailureReason reason;
+      std::promise<void> ret;
+    };
+    using Request = std::promise<nonstd::expected<RequestValue, FailureValue>>;

Review Comment:
   Why do we have promise in promise here?



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

Reply via email to