-
Notifications
You must be signed in to change notification settings - Fork 2
/
observer.go
46 lines (30 loc) · 841 Bytes
/
observer.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
package grmq
import (
"github.com/txix-open/grmq/consumer"
"github.com/txix-open/grmq/publisher"
)
type Observer interface {
ClientReady()
ClientError(err error)
ConsumerError(consumer consumer.Consumer, err error)
PublisherError(publisher *publisher.Publisher, err error)
PublishingFlow(publisher *publisher.Publisher, flow bool)
ShutdownStarted()
ShutdownDone()
}
type NoopObserver struct {
}
func (n NoopObserver) ClientReady() {
}
func (n NoopObserver) ClientError(err error) {
}
func (n NoopObserver) ConsumerError(consumer consumer.Consumer, err error) {
}
func (n NoopObserver) ShutdownStarted() {
}
func (n NoopObserver) ShutdownDone() {
}
func (n NoopObserver) PublisherError(publisher *publisher.Publisher, err error) {
}
func (n NoopObserver) PublishingFlow(publisher *publisher.Publisher, flow bool) {
}