MCPcopy
hub / github.com/mitmproxy/mitmproxy / watch

Method watch

mitmproxy/proxy/server.py:67–76  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

65 self.last_activity = time.time()
66
67 async def watch(self):
68 try:
69 while True:
70 await self.can_timeout.wait()
71 await asyncio.sleep(self.timeout - (time.time() - self.last_activity))
72 if self.last_activity + self.timeout < time.time():
73 await self.callback()
74 return
75 except asyncio.CancelledError:
76 return
77
78 @contextmanager
79 def disarm(self):

Callers 1

handle_clientMethod · 0.45

Calls 2

waitMethod · 0.80
callbackMethod · 0.45

Tested by

no test coverage detected