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

Merge pull request #58 from GingerMoon/patch-2

flush wrongly used in the sample code
This commit is contained in:
Ginger Collison 2020-05-01 13:37:40 -05:00 committed by GitHub
commit e9dee4367f
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 { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
nc.Flush()
// Send the request // Send the request immediately
nc.PublishRequest(subject, replyTo, []byte(input)) nc.PublishRequest(subject, replyTo, []byte(input))
nc.Flush()
// Wait for a single response // Wait for a single response
for { for {