proxygen
|
#include <ExpiringFilter.h>
Public Member Functions | |
ExpiringFilter (std::shared_ptr< Service< Req, Resp >> service, std::chrono::milliseconds idleTimeoutTime=std::chrono::milliseconds(0), std::chrono::milliseconds maxTime=std::chrono::milliseconds(0), folly::Timekeeper *timekeeper=nullptr) | |
~ExpiringFilter () override | |
void | startIdleTimer () |
folly::Future< Resp > | operator() (Req req) override |
Public Member Functions inherited from wangle::ServiceFilter< Req, Resp > | |
ServiceFilter (std::shared_ptr< Service< Req, Resp >> service) | |
~ServiceFilter () override=default | |
folly::Future< folly::Unit > | close () override |
bool | isAvailable () override |
Public Member Functions inherited from wangle::Service< Req, Resp > | |
virtual | ~Service ()=default |
Private Attributes | |
folly::Future< folly::Unit > | idleTimeout_ |
folly::Future< folly::Unit > | maxTimeout_ |
std::chrono::milliseconds | idleTimeoutTime_ {0} |
std::chrono::milliseconds | maxTime_ {0} |
folly::Timekeeper * | timekeeper_ |
uint32_t | requests_ {0} |
Additional Inherited Members | |
Protected Attributes inherited from wangle::ServiceFilter< Req, Resp > | |
std::shared_ptr< Service< Req, Resp > > | service_ |
A service filter that expires the self service after a certain amount of idle time, or after a maximum amount of time total. Idle timeout is cancelled when any requests are outstanding.
Definition at line 28 of file ExpiringFilter.h.
|
inlineexplicit |
Definition at line 30 of file ExpiringFilter.h.
References wangle::ServiceFilter< Req, Resp >::close(), wangle::ExpiringFilter< Req, Resp >::maxTime_, wangle::ExpiringFilter< Req, Resp >::maxTimeout_, folly::gen::move, folly::futures::sleep(), wangle::ExpiringFilter< Req, Resp >::startIdleTimer(), and wangle::ExpiringFilter< Req, Resp >::timekeeper_.
|
inlineoverride |
Definition at line 48 of file ExpiringFilter.h.
References wangle::ExpiringFilter< Req, Resp >::idleTimeout_, and wangle::ExpiringFilter< Req, Resp >::maxTimeout_.
|
inlineoverridevirtual |
Implements wangle::Service< Req, Resp >.
Definition at line 67 of file ExpiringFilter.h.
References wangle::ExpiringFilter< Req, Resp >::idleTimeout_, folly::gen::move, wangle::ExpiringFilter< Req, Resp >::requests_, wangle::ServiceFilter< Req, Resp >::service_, and wangle::ExpiringFilter< Req, Resp >::startIdleTimer().
|
inline |
Definition at line 57 of file ExpiringFilter.h.
References wangle::ServiceFilter< Req, Resp >::close(), wangle::ExpiringFilter< Req, Resp >::idleTimeout_, wangle::ExpiringFilter< Req, Resp >::idleTimeoutTime_, folly::gen::move, wangle::ExpiringFilter< Req, Resp >::requests_, folly::futures::sleep(), and wangle::ExpiringFilter< Req, Resp >::timekeeper_.
Referenced by wangle::ExpiringFilter< Req, Resp >::ExpiringFilter(), and wangle::ExpiringFilter< Req, Resp >::operator()().
|
private |
Definition at line 79 of file ExpiringFilter.h.
Referenced by wangle::ExpiringFilter< Req, Resp >::operator()(), wangle::ExpiringFilter< Req, Resp >::startIdleTimer(), and wangle::ExpiringFilter< Req, Resp >::~ExpiringFilter().
|
private |
Definition at line 81 of file ExpiringFilter.h.
Referenced by wangle::ExpiringFilter< Req, Resp >::startIdleTimer().
|
private |
Definition at line 82 of file ExpiringFilter.h.
Referenced by wangle::ExpiringFilter< Req, Resp >::ExpiringFilter().
|
private |
Definition at line 80 of file ExpiringFilter.h.
Referenced by wangle::ExpiringFilter< Req, Resp >::ExpiringFilter(), and wangle::ExpiringFilter< Req, Resp >::~ExpiringFilter().
|
private |
Definition at line 84 of file ExpiringFilter.h.
Referenced by wangle::ExpiringFilter< Req, Resp >::operator()(), and wangle::ExpiringFilter< Req, Resp >::startIdleTimer().
|
private |
Definition at line 83 of file ExpiringFilter.h.
Referenced by wangle::ExpiringFilter< Req, Resp >::ExpiringFilter(), and wangle::ExpiringFilter< Req, Resp >::startIdleTimer().