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

Function register_session_implement_for_target

pywebio/session/__init__.py:190–204  ·  view source on GitHub ↗

根据target_func函数类型注册会话实现,并返回会话实现 Register the session implementation according to the target_func function type, and return the session implementation

(target_func)

Source from the content-addressed store, hash-verified

188
189
190def register_session_implement_for_target(target_func):
191 """根据target_func函数类型注册会话实现,并返回会话实现
192 Register the session implementation according to the target_func function type, and return the session implementation"""
193 if iscoroutinefunction(target_func) or isgeneratorfunction(target_func):
194 cls = CoroutineBasedSession
195 else:
196 cls = ThreadBasedSession
197
198 if ScriptModeSession in _active_session_cls:
199 raise RuntimeError("Already in script mode, can't start server")
200
201 if cls not in _active_session_cls:
202 _active_session_cls.append(cls)
203
204 return cls
205
206
207def get_session_implement():

Callers 4

webio_routesFunction · 0.85
webio_handlerFunction · 0.85
webio_handlerFunction · 0.85
__init__Method · 0.85

Calls 3

iscoroutinefunctionFunction · 0.85
isgeneratorfunctionFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…