proxygen
RequestHandler.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 #pragma once
11 
13 
14 namespace proxygen {
15 
16 class ResponseHandler;
17 class ExMessageHandler;
18 
25  public:
35  downstream_ = CHECK_NOTNULL(handler);
36  }
37 
42  virtual void onRequest(std::unique_ptr<HTTPMessage> headers) noexcept = 0;
43 
47  virtual void onBody(std::unique_ptr<folly::IOBuf> body) noexcept = 0;
48 
52  virtual void onUpgrade(proxygen::UpgradeProtocol prot) noexcept = 0;
53 
57  virtual void onEOM() noexcept = 0;
58 
66  virtual void requestComplete() noexcept = 0;
67 
77  virtual void onError(ProxygenError err) noexcept = 0;
78 
84  virtual void onEgressPaused() noexcept {
85  }
86 
87  virtual void onEgressResumed() noexcept {
88  }
89 
94  virtual bool canHandleExpect() noexcept {
95  return false;
96  }
97 
101  virtual ExMessageHandler* getExHandler() noexcept {
102  LOG(FATAL) << "Not implemented";
103  }
104 
105  virtual ResponseHandler* getDownstream() noexcept {
106  return downstream_;
107  }
108 
109  virtual ~RequestHandler() {}
110 
111  protected:
117 };
118 
119 }
virtual ExMessageHandler * getExHandler() noexcept
virtual void setResponseHandler(ResponseHandler *handler) noexcept
virtual void onEOM() noexcept=0
virtual bool canHandleExpect() noexcept
virtual void requestComplete() noexcept=0
requires E e noexcept(noexcept(s.error(std::move(e))))
void handler(int, siginfo_t *, void *)
virtual void onEgressPaused() noexcept
virtual void onRequest(std::unique_ptr< HTTPMessage > headers) noexcept=0
virtual ResponseHandler * getDownstream() noexcept
virtual void onUpgrade(proxygen::UpgradeProtocol prot) noexcept=0
virtual void onError(ProxygenError err) noexcept=0
ResponseHandler * downstream_
virtual void onEgressResumed() noexcept
virtual void onBody(std::unique_ptr< folly::IOBuf > body) noexcept=0