MCPcopy Index your code
hub / github.com/python/cpython / Connection

Class Connection

Lib/multiprocessing/dummy/connection.py:51–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50
51class Connection(object):
52
53 def __init__(self, _in, _out):
54 self._out = _out
55 self._in = _in
56 self.send = self.send_bytes = _out.put
57 self.recv = self.recv_bytes = _in.get
58
59 def poll(self, timeout=0.0):
60 if self._in.qsize() > 0:
61 return True
62 if timeout <= 0.0:
63 return False
64 with self._in.not_empty:
65 self._in.not_empty.wait(timeout)
66 return self._in.qsize() > 0
67
68 def close(self):
69 pass
70
71 def __enter__(self):
72 return self
73
74 def __exit__(self, exc_type, exc_value, exc_tb):
75 self.close()

Callers 3

acceptMethod · 0.70
ClientFunction · 0.70
PipeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…