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

Function exec_future

chatbot/python/chatbot.py:78–92  ·  view source on GitHub ↗
(tid, code, text, params)

Source from the content-addressed store, hash-verified

76
77# Resolve or reject the future
78def exec_future(tid, code, text, params):
79 bundle = onCompletion.get(tid)
80 if bundle != None:
81 del onCompletion[tid]
82 try:
83 if code >= 200 and code < 400:
84 arg = bundle.get('arg')
85 bundle.get('onsuccess')(arg, params)
86 else:
87 log("Error: {} {} ({})".format(code, text, tid))
88 onerror = bundle.get('onerror')
89 if onerror:
90 onerror(bundle.get('arg'), {'code': code, 'text': text})
91 except Exception as err:
92 log("Error handling server response", err)
93
94# List of active subscriptions
95subscriptions = {}

Callers 1

client_message_loopFunction · 0.85

Calls 2

logFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…