21 namespace folly {
namespace io {
36 return transportDirection_;
40 bool isBusy()
const override {
return false; }
48 bool isReusable()
const override;
49 bool isWaitingToDrain()
const override;
51 void enableDoubleGoawayDrain()
override;
53 bool onIngressUpgradeMessage(
const HTTPMessage& msg)
override;
56 if (nextEgressStreamID > nextEgressStreamID_ &&
57 (nextEgressStreamID & 0x1) == (nextEgressStreamID_ & 0x1) &&
59 nextEgressStreamID_ = nextEgressStreamID;
64 bool odd = stream & 0x01;
65 bool upstream = (transportDirection_ == TransportDirection::UPSTREAM);
66 return (odd && upstream) || (!odd && !upstream);
70 bool isInitiated = isInitiatedStream(stream);
71 return (isInitiated && stream <= ingressGoawayAck_) ||
72 (!isInitiated && stream <= egressGoawayAck_);
86 OPEN_WITH_GRACEFUL_DRAIN_ENABLED = 1,
87 FIRST_GOAWAY_SENT = 2,
92 template<
typename T,
typename...
Args>
95 if (isStreamIngressEgressAllowed(stream)) {
97 (*
callback_.*callbackFn)(stream, std::forward<Args>(args)...);
101 VLOG(2) <<
"Suppressing " << cbName <<
" for stream=" <<
102 stream <<
" egressGoawayAck_=" << egressGoawayAck_;
void setCallback(Callback *callback) override
bool deliverCallbackIfAllowed(T callbackFn, char const *cbName, StreamID stream, Args &&...args)
bool isInitiatedStream(StreamID stream) const
void setNextEgressStreamId(StreamID nextEgressStreamID)
internal::ArgsMatcher< InnerMatcher > Args(const InnerMatcher &matcher)
—— Concurrent Priority Queue Implementation ——
std::string goawayErrorMessage_
bool supportsParallelRequests() const override
bool isBusy() const override
bool supportsStreamFlowControl() const override
void setParserPaused(bool) override
StreamID nextEgressStreamID_
void onIngressEOF() override
bool closeOnEgressComplete() const override
bool supportsSessionFlowControl() const override
bool isStreamIngressEgressAllowed(StreamID stream) const
StreamID getLastIncomingStreamID() const override
folly::Function< void()> callback_
TransportDirection transportDirection_
TransportDirection getTransportDirection() const override