提交 f3a92617 作者: keks 提交者: Steven Allen

core/commands/pubsub.go: flush output before iterating over received messages

License: MIT
Signed-off-by: 's avatarkeks <keks@cryposcope.co>
上级 b18b1e90
...@@ -5,6 +5,7 @@ import ( ...@@ -5,6 +5,7 @@ import (
"encoding/binary" "encoding/binary"
"fmt" "fmt"
"io" "io"
"net/http"
"sync" "sync"
"time" "time"
...@@ -109,6 +110,10 @@ This command outputs data in the following encodings: ...@@ -109,6 +110,10 @@ This command outputs data in the following encodings:
}() }()
} }
if f, ok := res.(http.Flusher); ok {
f.Flush()
}
for { for {
msg, err := sub.Next(req.Context()) msg, err := sub.Next(req.Context())
if err == io.EOF || err == context.Canceled { if err == io.EOF || err == context.Canceled {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论