代码拉取完成,页面将自动刷新
package publisher
import (
"github.com/elastic/beats/libbeat/common/op"
"github.com/elastic/beats/libbeat/logp"
)
type asyncPipeline struct {
outputs []worker
pub *Publisher
}
const (
defaultBulkSize = 2048
)
func newAsyncPipeline(
pub *Publisher,
hwm, bulkHWM int,
ws *workerSignal,
) *asyncPipeline {
p := &asyncPipeline{pub: pub}
var outputs []worker
for _, out := range pub.Output {
outputs = append(outputs, makeAsyncOutput(ws, hwm, bulkHWM, out))
}
p.outputs = outputs
return p
}
func (p *asyncPipeline) publish(m message) bool {
if p.pub.disabled {
debug("publisher disabled")
op.SigCompleted(m.context.Signal)
return true
}
if m.context.Signal != nil {
s := op.CancelableSignaler(m.client.canceler, m.context.Signal)
if len(p.outputs) > 1 {
s = op.SplitSignaler(s, len(p.outputs))
}
m.context.Signal = s
}
for _, o := range p.outputs {
o.send(m)
}
return true
}
func makeAsyncOutput(
ws *workerSignal,
hwm, bulkHWM int,
worker *outputWorker,
) worker {
config := worker.config
flushInterval := config.FlushInterval
maxBulkSize := config.BulkMaxSize
logp.Info("Flush Interval set to: %v", flushInterval)
logp.Info("Max Bulk Size set to: %v", maxBulkSize)
// batching disabled
if flushInterval <= 0 || maxBulkSize <= 0 {
return worker
}
debug("create bulk processing worker (interval=%v, bulk size=%v)",
flushInterval, maxBulkSize)
return newBulkWorker(ws, hwm, bulkHWM, worker, flushInterval, maxBulkSize)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。