1
#pragma once
2

            
3
#include "envoy/network/address.h"
4

            
5
#include "absl/functional/any_invocable.h"
6

            
7
namespace Envoy {
8
namespace Network {
9

            
10
/**
11
 * An interface through which a UDP listen socket, especially a QUIC socket, can
12
 * postpone reading during hot restart until the parent instance is drained.
13
 */
14
class ParentDrainedCallbackRegistrar {
15
public:
16
  /**
17
   * @param address is the address of the listener.
18
   * @param callback the function to call when the listener matching address is
19
   *                 drained on the parent instance.
20
   */
21
  virtual void registerParentDrainedCallback(const Address::InstanceConstSharedPtr& address,
22
                                             absl::AnyInvocable<void()> callback) PURE;
23

            
24
protected:
25
141
  virtual ~ParentDrainedCallbackRegistrar() = default;
26
};
27

            
28
} // namespace Network
29
} // namespace Envoy