MCPcopy
hub / github.com/google/mtail / Run

Method Run

internal/runtime/vm/vm.go:1052–1060  ·  view source on GitHub ↗

Run starts the VM and processes lines coming in on the input channel. When the channel is closed, and the VM has finished processing the VM is shut down and the loader signalled via the given waitgroup.

(lines <-chan *logline.LogLine, wg *sync.WaitGroup)

Source from the content-addressed store, hash-verified

1050// the channel is closed, and the VM has finished processing the VM is shut
1051// down and the loader signalled via the given waitgroup.
1052func (v *VM) Run(lines <-chan *logline.LogLine, wg *sync.WaitGroup) {
1053 defer wg.Done()
1054 glog.V(1).Infof("started VM %q", v.name)
1055 ctx := context.TODO()
1056 for line := range lines {
1057 v.ProcessLogLine(ctx, line)
1058 }
1059 glog.Infof("VM %q finished", v.name)
1060}

Callers 15

TestRuntimeEndToEndFunction · 0.45
CompileAndRunMethod · 0.45
TestTypeUnificationFunction · 0.45
TestInferCaprefTypeFunction · 0.45
TestCheckInvalidProgramsFunction · 0.45
TestCheckValidProgramsFunction · 0.45
TestCheckTypeExpressionsFunction · 0.45
TestLexFunction · 0.45
TestParserRoundTripFunction · 0.45
TestParseInvalidProgramsFunction · 0.45
TestParsePositionTestsFunction · 0.45
TestCodeGenFromSourceFunction · 0.45

Calls 1

ProcessLogLineMethod · 0.95

Tested by 15

TestRuntimeEndToEndFunction · 0.36
TestTypeUnificationFunction · 0.36
TestInferCaprefTypeFunction · 0.36
TestCheckInvalidProgramsFunction · 0.36
TestCheckValidProgramsFunction · 0.36
TestCheckTypeExpressionsFunction · 0.36
TestLexFunction · 0.36
TestParserRoundTripFunction · 0.36
TestParseInvalidProgramsFunction · 0.36
TestParsePositionTestsFunction · 0.36
TestCodeGenFromSourceFunction · 0.36
TestCodeGenFromASTFunction · 0.36