1
0
mirror of https://github.com/taigrr/nats.docs synced 2025-01-18 04:03:23 -08:00

flush wrongly used in the sample code

This commit is contained in:
Moon Wang 2020-02-19 19:55:34 +08:00 committed by GitHub
parent 7d4a08f4bd
commit 06e04e522e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,10 +119,10 @@ sub, err := nc.SubscribeSync(replyTo)
if err != nil {
log.Fatal(err)
}
nc.Flush()
// Send the request
// Send the request immeditately
nc.PublishRequest(subject, replyTo, []byte(input))
nc.Flush()
// Wait for a single response
for {