How csvq.SetStdout works across multiple processes?
hw2499 opened this issue · 3 comments
hw2499 commented
How csvq.SetStdout works across multiple processes?
I hope it works properly in multiple threads.
for i1 := 0; i1 < 20; i1++ {
go func(){
... to do thing ...
stdout := query.NewOutput()
csvq.SetStdout(stdout)
... to do thing ...
fmt.Println("stdout.String:", stdout.String())
if len(stdout.String()) == 0 {
fmt.Println("error -> query is null")
}
}()
}
runtime.Gosched()
time.Sleep(5 * time.Second)
fmt.Println("over")
mithrandie commented
Csvq does not intend to use different inputs and outputs for different threads, and specifying them in a goroutine will affect other goroutines as well.
hw2499 commented
How can CSVQ create multiple instances?
mithrandie commented
Sorry, I missed this question.
Outputs are only intended for logging, so multiple output destinations are not currently available.