@@ -208,11 +208,7 @@ def send(self, obj):
208
208
209
209
This blocks until the object is received.
210
210
"""
211
- _channels .send (self ._id , obj )
212
- # XXX We are missing a low-level channel_send_wait().
213
- # See bpo-32604 and gh-19829.
214
- # Until that shows up we fake it:
215
- time .sleep (2 )
211
+ _channels .send (self ._id , obj , blocking = True )
216
212
217
213
def send_nowait (self , obj ):
218
214
"""Send the object to the channel's receiving end.
@@ -223,22 +219,22 @@ def send_nowait(self, obj):
223
219
# XXX Note that at the moment channel_send() only ever returns
224
220
# None. This should be fixed when channel_send_wait() is added.
225
221
# See bpo-32604 and gh-19829.
226
- return _channels .send (self ._id , obj )
222
+ return _channels .send (self ._id , obj , blocking = False )
227
223
228
224
def send_buffer (self , obj ):
229
225
"""Send the object's buffer to the channel's receiving end.
230
226
231
227
This blocks until the object is received.
232
228
"""
233
- _channels .send_buffer (self ._id , obj )
229
+ _channels .send_buffer (self ._id , obj , blocking = True )
234
230
235
231
def send_buffer_nowait (self , obj ):
236
232
"""Send the object's buffer to the channel's receiving end.
237
233
238
234
If the object is immediately received then return True
239
235
(else False). Otherwise this is the same as send().
240
236
"""
241
- return _channels .send_buffer (self ._id , obj )
237
+ return _channels .send_buffer (self ._id , obj , blocking = False )
242
238
243
239
def close (self ):
244
240
_channels .close (self ._id , send = True )
0 commit comments