good morning!!!!

Skip to content
Snippets Groups Projects
Commit 20ddabc2 authored by a's avatar a
Browse files

once again the tests they pas yo

parent 2ac9623f
Branches
Tags
No related merge requests found
...@@ -227,20 +227,24 @@ func (h *handler) handleCall(cp *callProc, msg *jsonrpcMessage) *jsonrpcMessage ...@@ -227,20 +227,24 @@ func (h *handler) handleCall(cp *callProc, msg *jsonrpcMessage) *jsonrpcMessage
req := &Request{ctx: cp.ctx, msg: *msg, peer: h.peer} req := &Request{ctx: cp.ctx, msg: *msg, peer: h.peer}
mw := NewReaderResponseWriterMsg(req) mw := NewReaderResponseWriterMsg(req)
h.reg.ServeRPC(mw, req) h.reg.ServeRPC(mw, req)
if mw.notifications != nil {
for { //TODO: notifications
val, more := <-mw.notifications //if mw.notifications != nil {
if !more { // go func() {
break // for {
} // val, more := <-mw.notifications
err := h.conn.writeJSON(cp.ctx, val) // if !more {
if err != nil { // break
if mw.notifications != nil { // }
close(mw.notifications) // err := h.conn.writeJSON(cp.ctx, val)
} // if err != nil {
return msg.errorResponse(err) // if mw.notifications != nil {
} // close(mw.notifications)
} // }
} // log.Println("error in notification", err)
// }
// }
// }()
//}
return mw.msg return mw.msg
} }
...@@ -138,7 +138,10 @@ func (w *ResponseWriterMsg) Notify(args any) (err error) { ...@@ -138,7 +138,10 @@ func (w *ResponseWriterMsg) Notify(args any) (err error) {
cm := w.r.Msg() cm := w.r.Msg()
nf := cm.response(args) nf := cm.response(args)
nf.ID = nil nf.ID = nil
w.notifications <- nf select {
case w.notifications <- nf:
default:
}
return nil return nil
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment