Skip to content

Commit

Permalink
core/commands/pubsub.go: flush output before iterating over received …
Browse files Browse the repository at this point in the history
…messages

License: MIT
Signed-off-by: keks <keks@cryposcope.co>
  • Loading branch information
keks authored and Stebalien committed Nov 21, 2017
1 parent b18b1e9 commit f3a9261
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/commands/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/binary"
"fmt"
"io"
"net/http"
"sync"
"time"

Expand Down Expand Up @@ -109,6 +110,10 @@ This command outputs data in the following encodings:
}()
}

if f, ok := res.(http.Flusher); ok {
f.Flush()
}

for {
msg, err := sub.Next(req.Context())
if err == io.EOF || err == context.Canceled {
Expand Down

0 comments on commit f3a9261

Please sign in to comment.