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