Rename two callback function names of ConnectionEventCallback
authorMohammad Husain <mhusain@fb.com>
Mon, 26 Oct 2015 18:56:02 +0000 (11:56 -0700)
committerfacebook-github-bot-1 <folly-bot@fb.com>
Mon, 26 Oct 2015 19:20:21 +0000 (12:20 -0700)
Summary: Renaming `EnqueuedForAccept` and `DequeuedByAccept` to
`EnqueuedForAcceptor` and `DequeuedByAcceptor` respectively to make it clear
that the connection is queued for the Acceptor not to call `accept` on.

Reviewed By: yfeldblum

Differential Revision: D2554578

fb-gh-sync-id: 072a9ff122658827d1e89f2bef79ad565dad7974

folly/io/async/AsyncServerSocket.cpp
folly/io/async/AsyncServerSocket.h
folly/io/async/test/AsyncSocketTest2.cpp

index b2b2d24be7510999634bf48aabdd529bfb050439..f7a395c080d79e3b624058fbd50d91b2f197a3c5 100644 (file)
@@ -92,7 +92,7 @@ void AsyncServerSocket::RemoteAcceptor::messageAvailable(
     case MessageType::MSG_NEW_CONN:
     {
       if (connectionEventCallback_) {
-        connectionEventCallback_->onConnectionDequeuedByAcceptCallback(
+        connectionEventCallback_->onConnectionDequeuedByAcceptorCallback(
             msg.fd, msg.address);
       }
       callback_->connectionAccepted(msg.fd, msg.address);
@@ -824,8 +824,9 @@ void AsyncServerSocket::dispatchSocket(int socket,
   while (true) {
     if (info->consumer->getQueue()->tryPutMessageNoThrow(std::move(msg))) {
       if (connectionEventCallback_) {
-        connectionEventCallback_->onConnectionEnqueuedForAcceptCallback(socket,
-                                                                        addr);
+        connectionEventCallback_->onConnectionEnqueuedForAcceptorCallback(
+            socket,
+            addr);
       }
       // Success! return.
       return;
index 4f1194f7c98b3f4a766e2190c79cf4813149c29d..9b82ebd5597a0c903a627a8b4047581ee69d8c87 100644 (file)
@@ -95,18 +95,18 @@ class AsyncServerSocket : public DelayedDestruction
                                      const SocketAddress& addr) noexcept = 0;
 
     /**
-     * onConnectionEnqueuedForAcceptCallback() is called when the
+     * onConnectionEnqueuedForAcceptorCallback() is called when the
      * connection is successfully enqueued for an AcceptCallback to pick up.
      */
-    virtual void onConnectionEnqueuedForAcceptCallback(
+    virtual void onConnectionEnqueuedForAcceptorCallback(
         const int socket,
         const SocketAddress& addr) noexcept = 0;
 
     /**
-     * onConnectionDequeuedByAcceptCallback() is called when the
+     * onConnectionDequeuedByAcceptorCallback() is called when the
      * connection is successfully dequeued by an AcceptCallback.
      */
-    virtual void onConnectionDequeuedByAcceptCallback(
+    virtual void onConnectionDequeuedByAcceptorCallback(
         const int socket,
         const SocketAddress& addr) noexcept = 0;
 
index 2c822eef11c5b8e27eec46b73ab2de1e2ae6e84c..73295ca3b23ba90d5b4f817ab2f86512ed2fb4d9 100644 (file)
@@ -1480,14 +1480,14 @@ class TestConnectionEventCallback :
     connectionDropped_++;
   }
 
-  virtual void onConnectionEnqueuedForAcceptCallback(
+  virtual void onConnectionEnqueuedForAcceptorCallback(
       const int socket,
       const SocketAddress& addr) noexcept override {
     folly::RWSpinLock::WriteHolder holder(spinLock_);
     connectionEnqueuedForAcceptCallback_++;
   }
 
-  virtual void onConnectionDequeuedByAcceptCallback(
+  virtual void onConnectionDequeuedByAcceptorCallback(
       const int socket,
       const SocketAddress& addr) noexcept override {
     folly::RWSpinLock::WriteHolder holder(spinLock_);