From 0531f01146aacb062f7f2a31ac859c43ada1465e Mon Sep 17 00:00:00 2001 From: Edward Date: Thu, 7 May 2020 18:17:42 +0800 Subject: [PATCH] update fan_out_complex pattern --- gomore/05_fan_out/fan_out_complex_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gomore/05_fan_out/fan_out_complex_test.go b/gomore/05_fan_out/fan_out_complex_test.go index 365a63c..510ef8d 100644 --- a/gomore/05_fan_out/fan_out_complex_test.go +++ b/gomore/05_fan_out/fan_out_complex_test.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "testing" + "time" "google.golang.org/grpc" ) @@ -29,10 +30,13 @@ func TestComplexStreamingFanOut(t *testing.T) { pipeline: NewPipeline(builder, 2, true), } - tagging.pipeline.Start(context.Background()) - tagging.pipeline.Dispatch(messageContent{"all,please stay home", 1000}) + tagging.pipeline.Start(context.Background()) + + //模拟处理过程,让工作者线程完成工作 + time.Sleep(time.Second * 2) + t.Log("Done") } type Tagging struct {