diff options
| author | chrislu <chris.lu@gmail.com> | 2022-09-25 11:19:05 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-09-25 11:19:05 -0700 |
| commit | 600d2f92a44b8fb76653ef0547bce5a406e82eb8 (patch) | |
| tree | 7e45cf7c4e38540728e1049ccf21fbaec3675fa7 /weed/mq/messages/message_pipeline_test.go | |
| parent | 15b6c7a6f0adad7d0638b770c082d73f8a612c89 (diff) | |
| download | seaweedfs-600d2f92a44b8fb76653ef0547bce5a406e82eb8.tar.xz seaweedfs-600d2f92a44b8fb76653ef0547bce5a406e82eb8.zip | |
add message pipeline
Diffstat (limited to 'weed/mq/messages/message_pipeline_test.go')
| -rw-r--r-- | weed/mq/messages/message_pipeline_test.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/weed/mq/messages/message_pipeline_test.go b/weed/mq/messages/message_pipeline_test.go new file mode 100644 index 000000000..aaa25e0fd --- /dev/null +++ b/weed/mq/messages/message_pipeline_test.go @@ -0,0 +1,29 @@ +package messages + +import ( + "testing" + "time" +) + +func TestAddMessage(t *testing.T) { + mp := NewMessagePipeline(0, 3, 10, time.Second, &EmptyMover{}) + go func() { + outChan := mp.OutputChan() + for mr := range outChan { + println(mr.sequence, mr.fileId) + } + }() + + for i := 0; i < 100; i++ { + message := &Message{ + Key: []byte("key"), + Content: []byte("data"), + Properties: nil, + Ts: time.Now(), + } + mp.AddMessage(message) + } + + mp.ShutdownStart() + mp.ShutdownWait() +} |
