SSE reconnect, task switcher state/inbox/new task, stream throttle
This commit is contained in:
@@ -45,6 +45,7 @@ type Event struct {
|
||||
Type string
|
||||
Subtype string
|
||||
Raw json.RawMessage
|
||||
Read time.Time
|
||||
}
|
||||
|
||||
type Block struct {
|
||||
@@ -505,6 +506,7 @@ func (s *Session) readLoop(stdout io.Reader) {
|
||||
}
|
||||
|
||||
func (s *Session) handleLine(line []byte) {
|
||||
read := time.Now()
|
||||
env := envelope{}
|
||||
err := json.Unmarshal(line, &env)
|
||||
if err != nil {
|
||||
@@ -540,7 +542,7 @@ func (s *Session) handleLine(line []byte) {
|
||||
s.idMu.Unlock()
|
||||
}
|
||||
|
||||
s.events <- Event{Type: env.Type, Subtype: env.Subtype, Raw: append(json.RawMessage{}, line...)}
|
||||
s.events <- Event{Type: env.Type, Subtype: env.Subtype, Raw: append(json.RawMessage{}, line...), Read: read}
|
||||
}
|
||||
|
||||
func (s *Session) learnScrub(raw json.RawMessage) {
|
||||
|
||||
Reference in New Issue
Block a user