proxygen
PushHandler.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 
15 namespace proxygen {
16 
17 class PushHandler : public RequestHandler {
18  public:
20  : innerHandler_(*this) {}
21 
22  // Caller may implement these callbacks if desired
23  void requestComplete() noexcept override { delete this; }
24  void onError(ProxygenError /*err*/) noexcept override { delete this; }
25 
27  return &innerHandler_;
28  }
29 
30  private:
32  public:
34  : handler_(handler) {}
35 
36  void setTransaction(HTTPTransaction* /*txn*/) noexcept override {}
38  void onError(const HTTPException& error) noexcept override {
39  handler_.onError(error.getProxygenError());
40  }
41  void onEgressPaused() noexcept override {
43  }
44  void onEgressResumed() noexcept override {
46  }
47 
48  private:
50  };
51 
52  void onRequest(std::unique_ptr<HTTPMessage> /*headers*/) noexcept override {
53  LOG(FATAL) << "Unreachable";
54  }
55 
56  void onBody(std::unique_ptr<folly::IOBuf> /*body*/) noexcept override {
57  LOG(FATAL) << "Unreachable";
58  }
59 
60  void onUpgrade(proxygen::UpgradeProtocol /*prot*/) noexcept override {
61  LOG(FATAL) << "Unreachable";
62  }
63 
64  void onEOM() noexcept override {
65  LOG(FATAL) << "Unreachable";
66  }
67 
69 
70 };
71 
72 }
void onBody(std::unique_ptr< folly::IOBuf >) noexceptoverride
Definition: PushHandler.h:56
HTTPPushTransactionHandler * getHandler()
Definition: PushHandler.h:26
void onEOM() noexceptoverride
Definition: PushHandler.h:64
void onError(const HTTPException &error) noexceptoverride
Definition: PushHandler.h:38
requires E e noexcept(noexcept(s.error(std::move(e))))
void onEgressPaused() noexceptoverride
Definition: PushHandler.h:41
requires And< SemiMovable< VN >... > &&SemiMovable< E > auto error(E e)
Definition: error.h:48
void handler(int, siginfo_t *, void *)
void setTransaction(HTTPTransaction *) noexceptoverride
Definition: PushHandler.h:36
virtual void onEgressPaused() noexcept
void detachTransaction() noexceptoverride
Definition: PushHandler.h:37
InnerPushHandler innerHandler_
Definition: PushHandler.h:68
void requestComplete() noexceptoverride
Definition: PushHandler.h:23
void onRequest(std::unique_ptr< HTTPMessage >) noexceptoverride
Definition: PushHandler.h:52
void onError(ProxygenError) noexceptoverride
Definition: PushHandler.h:24
InnerPushHandler(PushHandler &handler)
Definition: PushHandler.h:33
void onEgressResumed() noexceptoverride
Definition: PushHandler.h:44
virtual void onEgressResumed() noexcept
void onUpgrade(proxygen::UpgradeProtocol) noexceptoverride
Definition: PushHandler.h:60