summaryrefslogtreecommitdiff
path: root/src/mongo/transport/session.h
diff options
context:
space:
mode:
authorJason Carey <jcarey@argv.me>2018-03-21 00:15:35 -0400
committerJason Carey <jcarey@argv.me>2018-04-27 19:49:28 -0400
commit4ddf18bcf4d517c3dc0f005f9222ffaab9a86ffa (patch)
tree438865c1065d0a96c427b1ed3a89e5163d85699a /src/mongo/transport/session.h
parent91eaa878c4feeebd9397c49180631fc719238aaf (diff)
downloadmongo-4ddf18bcf4d517c3dc0f005f9222ffaab9a86ffa.tar.gz
SERVER-34739 Migrate to 1 connpool in ARS
Migrate to 1 connection pool in mongos. This change involves the introduction of a transport layer baton, which improves perf for a particular transport layer when doing local scatter/gather operations.
Diffstat (limited to 'src/mongo/transport/session.h')
-rw-r--r--src/mongo/transport/session.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mongo/transport/session.h b/src/mongo/transport/session.h
index bfe45a6cbe2..304c8f11da4 100644
--- a/src/mongo/transport/session.h
+++ b/src/mongo/transport/session.h
@@ -44,6 +44,8 @@ namespace transport {
class TransportLayer;
class Session;
+class Baton;
+using BatonHandle = std::shared_ptr<Baton>;
using SessionHandle = std::shared_ptr<Session>;
using ConstSessionHandle = std::shared_ptr<const Session>;
@@ -103,7 +105,7 @@ public:
* Source (receive) a new Message from the remote host for this Session.
*/
virtual StatusWith<Message> sourceMessage() = 0;
- virtual Future<Message> asyncSourceMessage() = 0;
+ virtual Future<Message> asyncSourceMessage(const transport::BatonHandle& handle = nullptr) = 0;
/**
* Sink (send) a Message to the remote host for this Session.
@@ -111,14 +113,15 @@ public:
* Async version will keep the buffer alive until the operation completes.
*/
virtual Status sinkMessage(Message message) = 0;
- virtual Future<void> asyncSinkMessage(Message message) = 0;
+ virtual Future<void> asyncSinkMessage(Message message,
+ const transport::BatonHandle& handle = nullptr) = 0;
/**
* Cancel any outstanding async operations. There is no way to cancel synchronous calls.
* Futures will finish with an ErrorCodes::CallbackCancelled error if they haven't already
* completed.
*/
- virtual void cancelAsyncOperations() = 0;
+ virtual void cancelAsyncOperations(const transport::BatonHandle& handle = nullptr) = 0;
/**
* This should only be used to detect when the remote host has disappeared without