proxygen
wangle::ServerAcceptor< Pipeline >::ServerConnection Class Reference

#include <ServerBootstrap-inl.h>

Inheritance diagram for wangle::ServerAcceptor< Pipeline >::ServerConnection:
wangle::ManagedConnection wangle::PipelineManager folly::HHWheelTimer::Callback folly::DelayedDestruction folly::DelayedDestructionBase

Public Member Functions

 ServerConnection (typename Pipeline::Ptr pipeline)
 
void timeoutExpired () noexceptoverride
 
void describe (std::ostream &) const override
 
bool isBusy () const override
 
void notifyPendingShutdown () override
 
void closeWhenIdle () override
 
void dropConnection () override
 
void dumpConnectionState (uint8_t) override
 
void deletePipeline (wangle::PipelineBase *p) override
 
void init ()
 
void refreshTimeout () override
 
- Public Member Functions inherited from wangle::ManagedConnection
 ManagedConnection ()
 
virtual std::chrono::milliseconds getIdleTime () const
 
void fireNotifyPendingShutdown ()
 
void fireCloseWhenIdle (bool force_to_close=false)
 
virtual void resetTimeout ()
 
void resetTimeoutTo (std::chrono::milliseconds)
 
virtual void scheduleTimeout (folly::HHWheelTimer::Callback *callback, std::chrono::milliseconds timeout)
 
ConnectionManagergetConnectionManager ()
 
- Public Member Functions inherited from folly::HHWheelTimer::Callback
 Callback ()=default
 
virtual ~Callback ()
 
virtual void callbackCanceled () noexcept
 
void cancelTimeout ()
 
bool isScheduled () const
 
std::chrono::milliseconds getTimeRemaining ()
 
- Public Member Functions inherited from folly::DelayedDestruction
virtual void destroy ()
 
bool getDestroyPending () const
 
- Public Member Functions inherited from folly::DelayedDestructionBase
virtual ~DelayedDestructionBase ()=default
 
- Public Member Functions inherited from wangle::PipelineManager
virtual ~PipelineManager ()=default
 

Private Member Functions

 ~ServerConnection () override
 

Private Attributes

Pipeline::Ptr pipeline_
 

Additional Inherited Members

- Protected Member Functions inherited from wangle::ManagedConnection
 ~ManagedConnection () override
 
- Protected Member Functions inherited from folly::HHWheelTimer::Callback
virtual std::chrono::steady_clock::time_point getCurTime ()
 
- Protected Member Functions inherited from folly::DelayedDestruction
 ~DelayedDestruction () override=default
 
 DelayedDestruction ()
 
- Protected Member Functions inherited from folly::DelayedDestructionBase
 DelayedDestructionBase ()
 
uint32_t getDestructorGuardCount () const
 

Detailed Description

template<typename Pipeline>
class wangle::ServerAcceptor< Pipeline >::ServerConnection

Definition at line 69 of file ServerBootstrap-inl.h.

Constructor & Destructor Documentation

template<typename Pipeline >
wangle::ServerAcceptor< Pipeline >::ServerConnection::ServerConnection ( typename Pipeline::Ptr  pipeline)
inlineexplicit

Definition at line 72 of file ServerBootstrap-inl.h.

73  : pipeline_(std::move(pipeline)) {
74  pipeline_->setPipelineManager(this);
75  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
template<typename Pipeline >
wangle::ServerAcceptor< Pipeline >::ServerConnection::~ServerConnection ( )
inlineoverrideprivate

Definition at line 110 of file ServerBootstrap-inl.h.

110  {
111  pipeline_->setPipelineManager(nullptr);
112  }

Member Function Documentation

template<typename Pipeline >
void wangle::ServerAcceptor< Pipeline >::ServerConnection::closeWhenIdle ( )
inlineoverridevirtual

Instruct the connection that it should shutdown as soon as it is safe. This is called after notifyPendingShutdown().

Implements wangle::ManagedConnection.

Definition at line 88 of file ServerBootstrap-inl.h.

88 {}
template<typename Pipeline >
void wangle::ServerAcceptor< Pipeline >::ServerConnection::deletePipeline ( wangle::PipelineBase p)
inlineoverridevirtual

Implements wangle::PipelineManager.

Definition at line 96 of file ServerBootstrap-inl.h.

References destroy().

96  {
97  CHECK(p == pipeline_.get());
98  destroy();
99  }
template<typename Pipeline >
void wangle::ServerAcceptor< Pipeline >::ServerConnection::describe ( std::ostream &  os) const
inlineoverridevirtual

Print a human-readable description of the connection.

Parameters
osDestination stream.

Implements wangle::ManagedConnection.

Definition at line 83 of file ServerBootstrap-inl.h.

83 {}
template<typename Pipeline >
void wangle::ServerAcceptor< Pipeline >::ServerConnection::dropConnection ( )
inlineoverridevirtual

Forcibly drop a connection.

If a request is in progress, this should cause the connection to be closed with a reset.

Implements wangle::ManagedConnection.

Definition at line 89 of file ServerBootstrap-inl.h.

References wangle::AcceptorException::DROPPED.

89  {
90  auto ew = folly::make_exception_wrapper<AcceptorException>(
92  pipeline_->readException(ew);
93  }
template<typename Pipeline >
void wangle::ServerAcceptor< Pipeline >::ServerConnection::dumpConnectionState ( uint8_t  loglevel)
inlineoverridevirtual

Dump the state of the connection to the log

Implements wangle::ManagedConnection.

Definition at line 94 of file ServerBootstrap-inl.h.

94 {}
template<typename Pipeline >
void wangle::ServerAcceptor< Pipeline >::ServerConnection::init ( )
inline

Definition at line 101 of file ServerBootstrap-inl.h.

101  {
102  pipeline_->transportActive();
103  }
template<typename Pipeline >
bool wangle::ServerAcceptor< Pipeline >::ServerConnection::isBusy ( ) const
inlineoverridevirtual

Check whether the connection has any requests outstanding.

Implements wangle::ManagedConnection.

Definition at line 84 of file ServerBootstrap-inl.h.

84  {
85  return true;
86  }
template<typename Pipeline >
void wangle::ServerAcceptor< Pipeline >::ServerConnection::notifyPendingShutdown ( )
inlineoverridevirtual

Notify the connection that a shutdown is pending. This method will be called at the beginning of graceful shutdown.

Implements wangle::ManagedConnection.

Definition at line 87 of file ServerBootstrap-inl.h.

87 {}
template<typename Pipeline >
void wangle::ServerAcceptor< Pipeline >::ServerConnection::refreshTimeout ( )
inlineoverridevirtual

Reimplemented from wangle::PipelineManager.

Definition at line 105 of file ServerBootstrap-inl.h.

105  {
106  resetTimeout();
107  }
template<typename Pipeline >
void wangle::ServerAcceptor< Pipeline >::ServerConnection::timeoutExpired ( )
inlineoverridevirtualnoexcept

timeoutExpired() is invoked when the timeout has expired.

Implements wangle::ManagedConnection.

Definition at line 77 of file ServerBootstrap-inl.h.

References wangle::AcceptorException::TIMED_OUT.

77  {
78  auto ew = folly::make_exception_wrapper<AcceptorException>(
80  pipeline_->readException(ew);
81  }

Member Data Documentation

template<typename Pipeline >
Pipeline::Ptr wangle::ServerAcceptor< Pipeline >::ServerConnection::pipeline_
private

Definition at line 113 of file ServerBootstrap-inl.h.


The documentation for this class was generated from the following file: