|
@@ -15,6 +15,7 @@ type HttpView struct {
|
|
httpProto *proto.Http
|
|
httpProto *proto.Http
|
|
HttpRequests *util.Ring
|
|
HttpRequests *util.Ring
|
|
shutdown chan int
|
|
shutdown chan int
|
|
|
|
+ flush chan int
|
|
*area
|
|
*area
|
|
log.Logger
|
|
log.Logger
|
|
}
|
|
}
|
|
@@ -32,12 +33,13 @@ func colorFor(status string) termbox.Attribute {
|
|
return termbox.ColorWhite
|
|
return termbox.ColorWhite
|
|
}
|
|
}
|
|
|
|
|
|
-func NewHttp(proto *proto.Http, shutdown chan int, x, y int) *HttpView {
|
|
|
|
|
|
+func NewHttp(proto *proto.Http, flush, shutdown chan int, x, y int) *HttpView {
|
|
v := &HttpView{
|
|
v := &HttpView{
|
|
httpProto: proto,
|
|
httpProto: proto,
|
|
HttpRequests: util.NewRing(size),
|
|
HttpRequests: util.NewRing(size),
|
|
area: NewArea(x, y, 70, size+5),
|
|
area: NewArea(x, y, 70, size+5),
|
|
shutdown: shutdown,
|
|
shutdown: shutdown,
|
|
|
|
+ flush: flush,
|
|
Logger: log.NewPrefixLogger(),
|
|
Logger: log.NewPrefixLogger(),
|
|
}
|
|
}
|
|
v.AddLogPrefix("view")
|
|
v.AddLogPrefix("view")
|
|
@@ -76,5 +78,5 @@ func (v *HttpView) Render() {
|
|
v.APrintf(colorFor(txn.Resp.Status), 30, 3+i, "%s", txn.Resp.Status)
|
|
v.APrintf(colorFor(txn.Resp.Status), 30, 3+i, "%s", txn.Resp.Status)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- termbox.Flush()
|
|
|
|
|
|
+ v.flush <- 1
|
|
}
|
|
}
|