aboutsummaryrefslogtreecommitdiff
path: root/weed/util/queue_unbounded_test.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-02-20 15:44:17 -0800
committerChris Lu <chris.lu@gmail.com>2020-02-20 15:44:17 -0800
commit621cdbdf587dfd2218229055e74613ccae17d7d7 (patch)
tree9a266fa601f2367eaf3cbcdee997c0173d56c7f8 /weed/util/queue_unbounded_test.go
parent45156cc2feef983068dbd9c7c513fbb1772527b0 (diff)
downloadseaweedfs-621cdbdf587dfd2218229055e74613ccae17d7d7.tar.xz
seaweedfs-621cdbdf587dfd2218229055e74613ccae17d7d7.zip
filer: avoid possible timeouts for updates and deletions
Diffstat (limited to 'weed/util/queue_unbounded_test.go')
-rw-r--r--weed/util/queue_unbounded_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/weed/util/queue_unbounded_test.go b/weed/util/queue_unbounded_test.go
new file mode 100644
index 000000000..2d02032cb
--- /dev/null
+++ b/weed/util/queue_unbounded_test.go
@@ -0,0 +1,25 @@
+package util
+
+import "testing"
+
+func TestEnqueueAndConsume(t *testing.T) {
+
+ q := NewUnboundedQueue()
+
+ q.EnQueue("1", "2", "3")
+
+ f := func(items []string) {
+ for _, t := range items {
+ println(t)
+ }
+ println("-----------------------")
+ }
+ q.Consume(f)
+
+ q.Consume(f)
+
+ q.EnQueue("4", "5")
+ q.EnQueue("6", "7")
+ q.Consume(f)
+
+}