MCPcopy
hub / github.com/tinode/chat / newSession

Method newSession

server/topic_test.go:68–80  ·  view source on GitHub ↗
(sid string, uid types.Uid)

Source from the content-addressed store, hash-verified

66}
67
68func (b *TopicTestHelper) newSession(sid string, uid types.Uid) (*Session, *responses) {
69 s := &Session{
70 sid: sid,
71 uid: uid,
72 subs: make(map[string]*Subscription),
73 send: make(chan any, 10),
74 detach: make(chan string, 10),
75 }
76 r := &responses{}
77 b.sessWg.Add(1)
78 go s.testWriteLoop(r, b.sessWg)
79 return s, r
80}
81
82func (b *TopicTestHelper) setUp(t *testing.T, numUsers int, cat types.TopicCat, topicName string, attachSessions bool) {
83 t.Helper()

Calls 2

testWriteLoopMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected