8000 added dot count for fake work delay · falcon677/rabbitmq-tutorials@1720d85 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1720d85

Browse files
committed
added dot count for fake work delay
1 parent 1ae57f3 commit 1720d85

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

go/worker.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ func main() {
5757
for d := range msgs {
5858
log.Printf("Received a message: %s", d.Body)
5959
d.Ack(false)
60+
dot_count := bytes.Count(d.Body, []byte("."))
61+
t := time.Duration(dot_count)
62+
time.Sleep(t * time.Second)
6063
}
6164
}()
6265

0 commit comments

Comments
 (0)
0