forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 2
/
listener_hooks.h
42 lines (34 loc) · 912 Bytes
/
listener_hooks.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
#include "envoy/common/pure.h"
namespace Envoy {
/**
* Hooks in the server to allow for integration testing. The real server just uses an empty
* implementation defined below.
*/
class ListenerHooks {
public:
virtual ~ListenerHooks() = default;
/**
* Called when a worker has added a listener and it is listening.
*/
virtual void onWorkerListenerAdded() PURE;
/**
* Called when a worker has removed a listener and it is no longer listening.
*/
virtual void onWorkerListenerRemoved() PURE;
/**
* Called when all workers have started.
*/
virtual void onWorkersStarted() PURE;
};
/**
* Empty implementation of ListenerHooks.
*/
class DefaultListenerHooks : public ListenerHooks {
public:
// ListenerHooks
void onWorkerListenerAdded() override {}
void onWorkerListenerRemoved() override {}
void onWorkersStarted() override {}
};
} // namespace Envoy