MCPcopy Create free account
hub / github.com/wechaty/python-wechaty / instance

Method instance

src/wechaty/utils/async_helper.py:58–63  ·  view source on GitHub ↗

singleton pattern for MessageIdContainer

(cls)

Source from the content-addressed store, hash-verified

56
57 @classmethod
58 def instance(cls) -> SingleIdContainer:
59 """singleton pattern for MessageIdContainer"""
60 if cls._instance is None or len(cls._instance.ids) > cls._instance.max_size:
61 cls._instance = SingleIdContainer()
62
63 return cls._instance
64
65
66def single_message(on_message_func): # type: ignore

Callers 1

wrapperFunction · 0.45

Calls 1

SingleIdContainerClass · 0.85

Tested by

no test coverage detected