MCPcopy
hub / github.com/davyxu/cellnet / SessionQueuedCall

Function SessionQueuedCall

queue.go:140–149  ·  view source on GitHub ↗

在会话对应的Peer上的事件队列中执行callback,如果没有队列,则马上执行

(ses Session, callback func())

Source from the content-addressed store, hash-verified

138
139// 在会话对应的Peer上的事件队列中执行callback,如果没有队列,则马上执行
140func SessionQueuedCall(ses Session, callback func()) {
141 if ses == nil {
142 return
143 }
144 q := ses.Peer().(interface {
145 Queue() EventQueue
146 }).Queue()
147
148 QueuedCall(q, callback)
149}
150
151// 有队列时队列调用,无队列时直接调用
152func QueuedCall(queue EventQueue, callback func()) {

Callers 3

NewQueuedEventCallbackFunction · 0.92
CallFunction · 0.92
ResoleveInboundEventFunction · 0.92

Calls 3

QueuedCallFunction · 0.85
QueueMethod · 0.65
PeerMethod · 0.65

Tested by

no test coverage detected