proxygen
EchoHandler.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 
12 #include <folly/Memory.h>
14 
15 namespace proxygen {
16 class ResponseHandler;
17 }
18 
19 namespace EchoService {
20 
21 class EchoStats;
22 
24  public:
25  explicit EchoHandler(EchoStats* stats);
26 
27  void onRequest(std::unique_ptr<proxygen::HTTPMessage> headers)
28  noexcept override;
29 
30  void onBody(std::unique_ptr<folly::IOBuf> body) noexcept override;
31 
32  void onEOM() noexcept override;
33 
34  void onUpgrade(proxygen::UpgradeProtocol proto) noexcept override;
35 
36  void requestComplete() noexcept override;
37 
38  void onError(proxygen::ProxygenError err) noexcept override;
39 
40  private:
41  EchoStats* const stats_{nullptr};
42 
43  std::unique_ptr<folly::IOBuf> body_;
44 };
45 
46 }
requires E e noexcept(noexcept(s.error(std::move(e))))
std::unique_ptr< folly::IOBuf > body_
Definition: EchoHandler.h:43