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

Method next_client_event

pywebio/session/threadbased.py:131–142  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

129 self._on_task_command(self)
130
131 def next_client_event(self):
132 # 函数开始不需要判断 self.closed()
133 # 如果会话关闭,对 get_current_session().next_client_event() 的调用会抛出SessionNotFoundException
134
135 task_id = self.get_current_task_id()
136 event_mq = self.get_current_session().task_mqs.get(task_id)
137 if event_mq is None:
138 raise SessionNotFoundException
139 event = event_mq.get()
140 if event is None:
141 raise SessionClosedException
142 return event
143
144 def send_client_event(self, event):
145 """向会话发送来自用户浏览器的事件️

Callers

nothing calls this directly

Calls 3

get_current_task_idMethod · 0.95
get_current_sessionMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected