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

Method recv_nowait

Lib/test/support/channels.py:157–171  ·  view source on GitHub ↗

Return the next object from the channel. If none have been sent then return the default if one is provided or fail with ChannelEmptyError. Otherwise this is the same as recv().

(self, default=_NOT_SET)

Source from the content-addressed store, hash-verified

155 return obj
156
157 def recv_nowait(self, default=_NOT_SET):
158 """Return the next object from the channel.
159
160 If none have been sent then return the default if one
161 is provided or fail with ChannelEmptyError. Otherwise this
162 is the same as recv().
163 """
164 if default is _NOT_SET:
165 obj, unboundop = _channels.recv(self._id)
166 else:
167 obj, unboundop = _channels.recv(self._id, default)
168 if unboundop is not None:
169 assert obj is None, repr(obj)
170 return _resolve_unbound(unboundop)
171 return obj
172
173 def close(self):
174 _channels.close(self._id, recv=True)

Calls 2

_resolve_unboundFunction · 0.70
recvMethod · 0.45