MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / NewEventManager

Function NewEventManager

db/event_manager.go:58–64  ·  view source on GitHub ↗

time (ms) to wait before dropping event, when event queue is full Creates a new event manager. Sets up the event channel for async events, and the goroutine to monitor and process that channel.

(terminator chan bool)

Source from the content-addressed store, hash-verified

56// Creates a new event manager. Sets up the event channel for async events, and the goroutine to
57// monitor and process that channel.
58func NewEventManager(terminator chan bool) *EventManager {
59 return &EventManager{
60 eventHandlers: make(map[EventType][]EventHandler, 0),
61 activeEventTypes: make(map[EventType]bool),
62 terminator: terminator,
63 }
64}
65
66// Starts the listener queue for the event manager
67func (em *EventManager) Start(ctx context.Context, maxProcesses uint, waitTime int) {

Callers 12

TestDocumentChangeEventFunction · 0.85
TestDBStateChangeEventFunction · 0.85
TestCustomHandlerFunction · 0.85
TestUnhandledEventFunction · 0.85
TestWebhookBasicFunction · 0.85
TestWebhookOverflowsFunction · 0.85
TestWebhookOldDocFunction · 0.85
TestWebhookTimeoutFunction · 0.85
TestUnavailableWebhookFunction · 0.85
NewDatabaseContextFunction · 0.85

Calls

no outgoing calls

Tested by 11

TestDocumentChangeEventFunction · 0.68
TestDBStateChangeEventFunction · 0.68
TestCustomHandlerFunction · 0.68
TestUnhandledEventFunction · 0.68
TestWebhookBasicFunction · 0.68
TestWebhookOverflowsFunction · 0.68
TestWebhookOldDocFunction · 0.68
TestWebhookTimeoutFunction · 0.68
TestUnavailableWebhookFunction · 0.68