-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThrottle.h
More file actions
34 lines (27 loc) · 940 Bytes
/
Throttle.h
File metadata and controls
34 lines (27 loc) · 940 Bytes
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
#ifndef __THROTTLE_H__
#define __THROTTLE_H__
#include <string>
using namespace std;
//*******************************************************************
// Exception class for when things go wrong in the throttling process
class ThrottleException
{
public:
ThrottleException(string theMessage) : message(theMessage) {};
string message;
};
//*******************************************************************
// The outer-level controller for the throttling process. This class
// delegates the actual throttle implementation to an instance of
// IThrottleAdapter - but this wrapper layer simply insulates the developers
// from possible changes to the underlying adapter.
class Throttle
{
public:
Throttle(void);
virtual ~Throttle(void);
// Our one method to throttle the server to prevent
// the processing of incoming requests
void throttle() throw (ThrottleException);
};
#endif