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

Function subscribe

chatbot/python/chatbot.py:196–203  ·  view source on GitHub ↗
(topic)

Source from the content-addressed store, hash-verified

194 return pb.ClientMsg(login=pb.ClientLogin(id=tid, scheme=scheme, secret=secret))
195
196def subscribe(topic):
197 tid = next_id()
198 add_future(tid, {
199 'arg': topic,
200 'onsuccess': lambda topicName, unused: add_subscription(topicName),
201 'onerror': lambda topicName, errcode: subscription_failed(topicName, errcode),
202 })
203 return pb.ClientMsg(sub=pb.ClientSub(id=tid, topic=topic))
204
205def leave(topic):
206 tid = next_id()

Callers 2

client_message_loopFunction · 0.85
on_loginFunction · 0.85

Calls 4

next_idFunction · 0.85
add_futureFunction · 0.85
add_subscriptionFunction · 0.85
subscription_failedFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…