mirror of
https://github.com/crazybber/go-pattern-examples.git
synced 2024-11-25 05:06:03 +03:00
update fan_out_complex pattern
This commit is contained in:
parent
52134bfddd
commit
0531f01146
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
)
|
)
|
||||||
@ -29,10 +30,13 @@ func TestComplexStreamingFanOut(t *testing.T) {
|
|||||||
pipeline: NewPipeline(builder, 2, true),
|
pipeline: NewPipeline(builder, 2, true),
|
||||||
}
|
}
|
||||||
|
|
||||||
tagging.pipeline.Start(context.Background())
|
|
||||||
|
|
||||||
tagging.pipeline.Dispatch(messageContent{"all,please stay home", 1000})
|
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 {
|
type Tagging struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user