Beispiel #1
0
func Signal(signaler op.Signaler) ClientOption {
	return func(ctx Context) Context {
		if ctx.Signal == nil {
			ctx.Signal = signaler
		} else {
			ctx.Signal = op.CombineSignalers(ctx.Signal, signaler)
		}
		return ctx
	}
}
Beispiel #2
0
func (b *bulkWorker) publish() {
	b.output.send(message{
		context: Context{
			publishOptions: publishOptions{Guaranteed: b.guaranteed},
			Signal:         op.CombineSignalers(b.pending...),
		},
		data: b.data,
	})

	b.pending = nil
	b.guaranteed = false
	b.data = make([]outputs.Data, 0, b.maxBatchSize)
}
Beispiel #3
0
func (b *bulkWorker) publish() {
	b.output.send(message{
		context: Context{
			publishOptions: publishOptions{Guaranteed: b.guaranteed},
			Signal:         op.CombineSignalers(b.pending...),
		},
		event:  nil,
		events: b.events,
	})

	b.pending = nil
	b.guaranteed = false
	b.events = make([]common.MapStr, 0, b.maxBatchSize)
}