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

Method get_current_session

pywebio/session/threadbased.py:31–37  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

29
30 @classmethod
31 def get_current_session(cls) -> "ThreadBasedSession":
32 curr = id(threading.current_thread())
33 session = cls.thread2session.get(curr)
34 if session is None:
35 raise SessionNotFoundException("Can't find current session. "
36 "Maybe session closed or forget to use `register_thread()`.")
37 return session
38
39 @classmethod
40 def get_current_task_id(cls):

Callers 1

next_client_eventMethod · 0.95

Calls 3

idFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected