summaryrefslogtreecommitdiff
path: root/src/mongo/transport/ticket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/transport/ticket.cpp')
-rw-r--r--src/mongo/transport/ticket.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/mongo/transport/ticket.cpp b/src/mongo/transport/ticket.cpp
index 76bce1dc51e..77a290087dd 100644
--- a/src/mongo/transport/ticket.cpp
+++ b/src/mongo/transport/ticket.cpp
@@ -30,30 +30,27 @@
#include "mongo/transport/ticket.h"
#include "mongo/transport/ticket_impl.h"
+#include "mongo/transport/transport_layer.h"
namespace mongo {
namespace transport {
const Date_t Ticket::kNoExpirationDate{Date_t::max()};
-Ticket::Ticket(std::unique_ptr<TicketImpl> ticket) : _ticket(std::move(ticket)) {}
+Ticket::Ticket(TransportLayer* tl, std::unique_ptr<TicketImpl> ticket)
+ : _tl(tl), _ticket(std::move(ticket)) {}
Ticket::~Ticket() = default;
Ticket::Ticket(Ticket&&) = default;
Ticket& Ticket::operator=(Ticket&&) = default;
-Session::SessionId Ticket::sessionId() const {
- return _ticket->sessionId();
+Status Ticket::wait()&& {
+ return _tl->wait(std::move(*this));
}
-Date_t Ticket::expiration() const {
- return _ticket->expiration();
-}
-
-// TODO should this actually be const?
-TicketImpl* Ticket::impl() const {
- return _ticket.get();
+void Ticket::asyncWait(TicketCallback cb)&& {
+ return _tl->asyncWait(std::move(*this), std::move(cb));
}
} // namespace transport