MCPcopy Create free account
hub / github.com/daodst/chat / QueueOut

Method QueueOut

server/session.go:140–147  ·  view source on GitHub ↗

TODO(gene): unify simpleByteSender and QueueOut QueueOut attempts to send a SCM to a session; if the send buffer is full, time out is 1 second

(msg *ServerComMessage)

Source from the content-addressed store, hash-verified

138
139// QueueOut attempts to send a SCM to a session; if the send buffer is full, time out is 1 second
140func (s *Session) QueueOut(msg *ServerComMessage) {
141 data, _ := json.Marshal(msg)
142 select {
143 case s.send <- data:
144 case <-time.After(time.Second):
145 log.Println("session.queueOut: timeout")
146 }
147}
148
149// Message received, dispatch
150func (s *Session) dispatch(raw []byte) {

Callers 12

dispatchMethod · 0.95
subscribeMethod · 0.95
leaveMethod · 0.95
publishMethod · 0.95
loginMethod · 0.95
accMethod · 0.95
getMethod · 0.95
setMethod · 0.95
delMethod · 0.95
topicInitFunction · 0.80
serveWebSocketFunction · 0.80
runMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected