/
dispatch.go
60 lines (51 loc) · 1.68 KB
/
dispatch.go
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
53
54
55
56
57
58
59
60
package fact
import (
"time"
"github.com/dogmatiq/configkit"
"github.com/dogmatiq/testkit/engine/envelope"
)
// DispatchCycleBegun indicates that Engine.Dispatch() has been called with a
// message that is able to be routed to at least one handler.
type DispatchCycleBegun struct {
Envelope *envelope.Envelope
EngineTime time.Time
EnabledHandlers map[configkit.HandlerType]bool
}
// DispatchCycleCompleted indicates that a call Engine.Dispatch() has completed.
type DispatchCycleCompleted struct {
Envelope *envelope.Envelope
Error error
EnabledHandlers map[configkit.HandlerType]bool
}
// DispatchBegun indicates that Engine.Dispatch() has been called with a
// message that is able to be routed to at least one handler.
type DispatchBegun struct {
Envelope *envelope.Envelope
}
// DispatchCompleted indicates that a call Engine.Dispatch() has completed.
type DispatchCompleted struct {
Envelope *envelope.Envelope
Error error
}
// HandlingBegun indicates that a message is about to be handled by a specific
// handler.
type HandlingBegun struct {
HandlerName string
HandlerType configkit.HandlerType
Envelope *envelope.Envelope
}
// HandlingCompleted indicates that a message has been handled by a specific
// handler, either successfully or unsuccessfully.
type HandlingCompleted struct {
HandlerName string
HandlerType configkit.HandlerType
Envelope *envelope.Envelope
Error error
}
// HandlingSkipped indicates that a message has been not been handled by a
// specific handler, because handlers of that type are disabled.
type HandlingSkipped struct {
HandlerName string
HandlerType configkit.HandlerType
Envelope *envelope.Envelope
}