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

Method gen_coro_id

pywebio/session/coroutinebased.py:287–293  ·  view source on GitHub ↗

生成协程id

(coro=None)

Source from the content-addressed store, hash-verified

285
286 @staticmethod
287 def gen_coro_id(coro=None):
288 """生成协程id"""
289 name = 'coro'
290 if hasattr(coro, '__name__'):
291 name = coro.__name__
292
293 return '%s-%s' % (name, random_str(10))
294
295 def __init__(self, coro, session: CoroutineBasedSession, on_coro_stop=None):
296 """

Callers 1

__init__Method · 0.95

Calls 1

random_strFunction · 0.85

Tested by

no test coverage detected