proxygen
Actions.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-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.
7  */
8 
9 #pragma once
10 
11 #include <boost/variant.hpp>
12 #include <fizz/protocol/Actions.h>
13 #include <folly/futures/Future.h>
14 #include <folly/small_vector.h>
15 
16 namespace fizz {
17 namespace server {
18 
19 class State;
20 
25 
27  std::unique_ptr<folly::IOBuf> clientHello;
28 };
29 
36 
41 
42 using Action = boost::variant<
52 using AsyncActions = boost::variant<Actions, folly::Future<Actions>>;
53 
54 namespace detail {
55 
56 template <typename... Args>
57 Actions actions(Args&&... act) {
58  Actions acts;
59  fizz::detail::addAction(acts, std::forward<Args>(act)...);
60  return acts;
61 }
62 } // namespace detail
63 } // namespace server
64 } // namespace fizz
Actions actions(Args &&...act)
Definition: Actions.h:57
boost::variant< Actions, folly::Future< Actions >> AsyncActions
Definition: Actions.h:52
boost::variant< DeliverAppData, WriteToSocket, ReportHandshakeSuccess, ReportEarlyHandshakeSuccess, ReportError, MutateState, WaitForData, AttemptVersionFallback > Action
Definition: Actions.h:50
internal::ArgsMatcher< InnerMatcher > Args(const InnerMatcher &matcher)
State
See Core for details.
Definition: Core.h:43
void addAction(ActionsType &)
Definition: Actions.h:67
Definition: Actions.h:16
std::unique_ptr< folly::IOBuf > clientHello
Definition: Actions.h:27
folly::Function< void(State &)> MutateState
Definition: Actions.h:24