We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1085eca commit c256bfdCopy full SHA for c256bfd
nsq/nsq_test.go
@@ -11,6 +11,28 @@ import (
11
12
var host = "nsq"
13
14
+func TestDefaultFlow(t *testing.T) {
15
+ m := &Job{
16
+ Body: []byte("foo"),
17
+ }
18
+ w := NewWorker(
19
+ WithAddr(host+":4150"),
20
+ WithTopic("test"),
21
+ )
22
+ q, err := queue.NewQueue(
23
+ queue.WithWorker(w),
24
+ queue.WithWorkerCount(2),
25
26
+ assert.NoError(t, err)
27
+ q.Start()
28
+ time.Sleep(100 * time.Millisecond)
29
+ assert.NoError(t, q.Queue(m))
30
+ m.Body = []byte("new message")
31
32
+ q.Shutdown()
33
+ q.Wait()
34
+}
35
+
36
func TestShutdown(t *testing.T) {
37
w := NewWorker(
38
WithAddr(host+":4150"),
0 commit comments