Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetModulePath ¶
GetModulePath will return the source path of the given module under the github.com/uber/aresdb/subscriber. This function uses the default GOPATH/GOENV resolution to find the given module
Types ¶
type Batcher ¶
type Batcher struct {
// contains filtered or unexported fields
}
Batcher batches a sequence of tasks and send them to workers for execution asynchronously. A batch of size 2^x is flushed when either maxDelay has elapsed since the oldest task was added, or a max number of tasks have been queued.
func NewBatcher ¶
NewBatcher creates and starts a batcher with no worker. User must call StartWorker before any task can be processed.
func (*Batcher) Close ¶
func (b *Batcher) Close()
Close signals all workers to quit and blocks until all queued tasks are processed.
func (*Batcher) StartWorker ¶
StartWorker adds a worker to the batcher and runs it asynchronously. The worker func shall receive task batches from the channel, and notify the wait group when it quits.