Skip to content

Commit a9fd8b8

Browse files
feat: OnEvent should be part of the event processor interface (#233)
1 parent 8e1c24b commit a9fd8b8

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

pkg/client/client_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ func (m *MockProcessor) ProcessEvent(event event.UserEvent) bool {
5858
return result
5959
}
6060

61+
func (m *MockProcessor) OnEventDispatch(callback func(logEvent event.LogEvent)) (int, error) {
62+
return 0, nil
63+
}
64+
65+
func (m *MockProcessor) RemoveOnEventDispatch(id int) error {
66+
return nil
67+
}
68+
6169
type MockNotificationCenter struct {
6270
notification.Center
6371
mock.Mock

pkg/event/processor.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ import (
3535
// Processor processes events
3636
type Processor interface {
3737
ProcessEvent(event UserEvent) bool
38+
OnEventDispatch(callback func(logEvent LogEvent)) (int, error)
39+
RemoveOnEventDispatch(id int) error
3840
}
3941

4042
// BatchEventProcessor is used out of the box by the SDK to queue up and batch events to be sent to the Optimizely

0 commit comments

Comments
 (0)