Documentation ¶
Overview ¶
Event package is responsible for receiving events from 9volt components and dumping them to etcd. The event queue is powered by WORKER_COUNT workers and has a BUFFER_LEN buffer.
Unlike other components, the event queue does NOT get shutdown in the event of a backend failure - it gets *paused*. In the *pause* state, the event queue will simply discard any inbound messages and will NOT attempt to save them to the backend.
This is done in order to avoid potential race conditions where lagging/slower components continue to write to the event queue even though they've been asked to shutdown.
Index ¶
Constants ¶
const ( BUFFER_LEN = 1000 WORKER_COUNT = 20 WORKER_SLEEP = time.Duration(500) * time.Millisecond MAX_EVENT_AGE = 86400 // 24 hours )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Add ¶
Attempt to send an event to the event channel; discard event if event channel is full
func (*Client) AddWithErrorLog ¶
Helper for AddWithLog()