Repository navigation
Expand file tree
/
Copy pathIExceptionHandler.h
More file actions
52 lines (43 loc) · 1.75 KB
/
Copy pathIExceptionHandler.h
File metadata and controls
52 lines (43 loc) · 1.75 KB
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
43
44
45
46
47
48
49
50
51
52
#pragma once
#include <cstdint>
#include <exception>
namespace Disruptor
{
/**
* Callback handler for uncaught exceptions in the event processing cycle of the BatchEventProcessor<T>
*/
template <class T>
class IExceptionHandler
{
public:
virtual ~IExceptionHandler() = default;
/**
* Strategy for handling uncaught exceptions when processing an event. If the strategy wishes to terminate further processing by the BatchEventProcessor<T>
* then it should throw a ApplicationException
*
* \param ex exception that propagated from the IEventHandler<T>
* \param sequence sequence of the event which cause the exception.
* \param evt event being processed when the exception occurred
*/
virtual void handleEventException(const std::exception& ex, std::int64_t sequence, T& evt) = 0;
/**
* Callback to notify of an exception during ILifecycleAware.onStart()
*
* \param ex ex throw during the starting process.
*/
virtual void handleOnStartException(const std::exception& ex) = 0;
/**
* Callback to notify of an exception during ILifecycleAware.onShutdown()
*
* \param ex ex throw during the shutdown process.
*/
virtual void handleOnShutdownException(const std::exception& ex) = 0;
/**
* Callback to notify of an exception during ITimeoutHandler.onTimeout()
*
* \param ex ex throw during the starting process.
* \param sequence sequence of the event which cause the exception.
*/
virtual void handleOnTimeoutException(const std::exception& ex, std::int64_t sequence) = 0;
};
} // namespace Disruptor