MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / register_callback

Method register_callback

pywebio/session/base.py:153–159  ·  view source on GitHub ↗

向Session注册一个回调函数,返回回调id Session需要保证当收到前端发送的事件消息 ``{event: "callback",task_id: 回调id, data:...}`` 时, ``callback`` 回调函数被执行, 并传入事件消息中的 ``data`` 字段值作为参数

(self, callback, **options)

Source from the content-addressed store, hash-verified

151 pass
152
153 def register_callback(self, callback, **options):
154 """ 向Session注册一个回调函数,返回回调id
155
156 Session需要保证当收到前端发送的事件消息 ``{event: "callback",task_id: 回调id, data:...}`` 时,
157 ``callback`` 回调函数被执行, 并传入事件消息中的 ``data`` 字段值作为参数
158 """
159 raise NotImplementedError
160
161 def defer_call(self, func):
162 """设置会话结束时调用的函数。可以用于资源清理。

Callers 1

output_register_callbackFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected