MCPcopy Create free account
hub / github.com/microsoft/debugpy / MessageFactory

Class MessageFactory

tests/tests/test_timeline.py:17–30  ·  view source on GitHub ↗

A factory for DAP messages that are not bound to a message channel.

Source from the content-addressed store, hash-verified

15
16
17class MessageFactory(object):
18 """A factory for DAP messages that are not bound to a message channel."""
19
20 def __init__(self):
21 self._seq_iter = itertools.count(1)
22 self.messages = collections.OrderedDict()
23 self.event = functools.partial(self._make, messaging.Event)
24 self.request = functools.partial(self._make, messaging.Request)
25 self.response = functools.partial(self._make, messaging.Response)
26
27 def _make(self, message_type, *args, **kwargs):
28 message = message_type(None, next(self._seq_iter), *args, **kwargs)
29 self.messages[message.seq] = message
30 return message
31
32
33@pytest.fixture

Callers 4

test_eventFunction · 0.85
test_request_responseFunction · 0.85
test_conditionalFunction · 0.85
workerFunction · 0.85

Calls

no outgoing calls

Tested by 4

test_eventFunction · 0.68
test_request_responseFunction · 0.68
test_conditionalFunction · 0.68
workerFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…