func Signal(signaler outputs.Signaler) ClientOption { return func(ctx context) context { if ctx.signal == nil { ctx.signal = signaler } else { ctx.signal = outputs.NewCompositeSignaler(ctx.signal, signaler) } return ctx } }
func (b *bulkWorker) publish() { // TODO: remember/merge and forward context options to output worker b.output.send(message{ context: context{ signal: outputs.NewCompositeSignaler(b.pending...), }, events: b.events, }) b.pending = nil b.events = make([]common.MapStr, 0, b.maxBatchSize) }
func (b *bulkWorker) publish() { // TODO: remember/merge and forward context options to output worker b.output.send(message{ context: Context{ publishOptions: publishOptions{Guaranteed: b.guaranteed}, Signal: outputs.NewCompositeSignaler(b.pending...), }, event: nil, events: b.events, }) b.ws.AddEvent(-len(b.events)) b.pending = nil b.guaranteed = false b.events = make([]common.MapStr, 0, b.maxBatchSize) }