SolidWallOfCode commented on a change in pull request #7023:
URL: https://github.com/apache/trafficserver/pull/7023#discussion_r503905766



##########
File path: include/tscpp/api/nexthop.h
##########
@@ -30,20 +30,20 @@
 
 #include <ts/apidefs.h>
 
-// plugin callback commands.
 enum NHCmd { NH_MARK_UP, NH_MARK_DOWN };
 
-struct NHHealthStatus {
-  virtual bool isNextHopAvailable(TSHttpTxn txn, const char *hostname, const 
int port, void *ih = nullptr) = 0;
-  virtual void markNextHop(TSHttpTxn txn, const char *hostname, const int 
port, const NHCmd status, void *ih = nullptr,
-                           const time_t now = 0)                               
                            = 0;
-  virtual ~NHHealthStatus() {}
-};
+class TSNextHopSelectionStrategy
+{
+public:
+  TSNextHopSelectionStrategy(){};
+  virtual ~TSNextHopSelectionStrategy(){};
 
-struct NHPluginStrategy {
-  virtual void findNextHop(TSHttpTxn txnp, void *ih = nullptr)   = 0;
-  virtual bool nextHopExists(TSHttpTxn txnp, void *ih = nullptr) = 0;
-  virtual ~NHPluginStrategy() {}
+  virtual void findNextHop(TSHttpTxn txnp, time_t now = 0)                     
                                            = 0;
+  virtual void markNextHop(TSHttpTxn txnp, const char *hostname, const int 
port, const NHCmd status, const time_t now = 0) = 0;
+  virtual bool nextHopExists(TSHttpTxn txnp)                                   
                                            = 0;

Review comment:
       Is this really useful? Why not have `findNextHop` return `bool`? 




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to