Skip to content

Commit bec2d79

Browse files
committed
docs(example): send message synchronously
Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 62a3765 commit bec2d79

File tree

1 file changed

+5
-7
lines changed
  • _example/server-client/server

1 file changed

+5
-7
lines changed

_example/server-client/server/main.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,11 @@ func main() {
4141

4242
// assign tasks in queue
4343
for i := 0; i < taskN; i++ {
44-
go func(i int) {
45-
if err := q.Queue(&job{
46-
Message: fmt.Sprintf("handle the job: %d", i+1),
47-
}); err != nil {
48-
log.Fatal(err)
49-
}
50-
}(i)
44+
if err := q.Queue(&job{
45+
Message: fmt.Sprintf("handle the job: %d", i+1),
46+
}); err != nil {
47+
log.Fatal(err)
48+
}
5149
}
5250

5351
time.Sleep(1 * time.Second)

0 commit comments

Comments
 (0)