Skip to content

Commit fd91e36

Browse files
remove unused wait and timeout arguments from send method
1 parent cacb621 commit fd91e36

File tree

5 files changed

+9
-31
lines changed

5 files changed

+9
-31
lines changed

socketio/asyncio_client.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ async def emit(self, event, data=None, namespace=None, callback=None):
162162
packet.EVENT, namespace=namespace, data=[event] + data, id=id,
163163
binary=binary))
164164

165-
async def send(self, data, namespace=None, callback=None, wait=False,
166-
timeout=60):
165+
async def send(self, data, namespace=None, callback=None):
167166
"""Send a message to one or more connected clients.
168167
169168
This function emits an event with the name ``'message'``. Use
@@ -180,20 +179,11 @@ async def send(self, data, namespace=None, callback=None, wait=False,
180179
that will be passed to the function are those provided
181180
by the client. Callback functions can only be used
182181
when addressing an individual client.
183-
:param wait: If set to ``True``, this function will wait for the
184-
server to handle the event and acknowledge it via its
185-
callback function. The value(s) passed by the server to
186-
its callback will be returned. If set to ``False``,
187-
this function emits the event and returns immediately.
188-
:param timeout: If ``wait`` is set to ``True``, this parameter
189-
specifies a waiting timeout. If the timeout is reached
190-
before the server acknowledges the event, then a
191-
``TimeoutError`` exception is raised.
192182
193183
Note: this method is a coroutine.
194184
"""
195185
await self.emit('message', data=data, namespace=namespace,
196-
callback=callback, wait=wait, timeout=timeout)
186+
callback=callback)
197187

198188
async def call(self, event, data=None, namespace=None, timeout=60):
199189
"""Emit a custom event to a client and wait for the response.

socketio/client.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,7 @@ def emit(self, event, data=None, namespace=None, callback=None):
264264
data=[event] + data, id=id,
265265
binary=binary))
266266

267-
def send(self, data, namespace=None, callback=None, wait=False,
268-
timeout=60):
267+
def send(self, data, namespace=None, callback=None):
269268
"""Send a message to one or more connected clients.
270269
271270
This function emits an event with the name ``'message'``. Use
@@ -282,18 +281,9 @@ def send(self, data, namespace=None, callback=None, wait=False,
282281
that will be passed to the function are those provided
283282
by the client. Callback functions can only be used
284283
when addressing an individual client.
285-
:param wait: If set to ``True``, this function will wait for the
286-
server to handle the event and acknowledge it via its
287-
callback function. The value(s) passed by the server to
288-
its callback will be returned. If set to ``False``,
289-
this function emits the event and returns immediately.
290-
:param timeout: If ``wait`` is set to ``True``, this parameter
291-
specifies a waiting timeout. If the timeout is reached
292-
before the server acknowledges the event, then a
293-
``TimeoutError`` exception is raised.
294284
"""
295285
self.emit('message', data=data, namespace=namespace,
296-
callback=callback, wait=wait, timeout=timeout)
286+
callback=callback)
297287

298288
def call(self, event, data=None, namespace=None, timeout=60):
299289
"""Emit a custom event to a client and wait for the response.

socketio/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def emit(self, event, data=None, room=None, skip_sid=None, namespace=None,
242242
skip_sid=skip_sid, callback=callback, **kwargs)
243243

244244
def send(self, data, room=None, skip_sid=None, namespace=None,
245-
callback=None, wait=False, timeout=60, **kwargs):
245+
callback=None, **kwargs):
246246
"""Send a message to one or more connected clients.
247247
248248
This function emits an event with the name ``'message'``. Use

tests/asyncio/test_asyncio_client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,14 @@ def test_send(self):
240240
_run(c.send('data', 'namespace', 'callback'))
241241
c.emit.mock.assert_called_once_with(
242242
'message', data='data', namespace='namespace',
243-
callback='callback', wait=False, timeout=60)
243+
callback='callback')
244244

245245
def test_send_with_defaults(self):
246246
c = asyncio_client.AsyncClient()
247247
c.emit = AsyncMock()
248248
_run(c.send('data'))
249249
c.emit.mock.assert_called_once_with(
250-
'message', data='data', namespace=None, callback=None, wait=False,
251-
timeout=60)
250+
'message', data='data', namespace=None, callback=None)
252251

253252
def test_call(self):
254253
c = asyncio_client.AsyncClient()

tests/common/test_client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,15 +323,14 @@ def test_send(self):
323323
c.send('data', 'namespace', 'callback')
324324
c.emit.assert_called_once_with(
325325
'message', data='data', namespace='namespace',
326-
callback='callback', wait=False, timeout=60)
326+
callback='callback')
327327

328328
def test_send_with_defaults(self):
329329
c = client.Client()
330330
c.emit = mock.MagicMock()
331331
c.send('data')
332332
c.emit.assert_called_once_with(
333-
'message', data='data', namespace=None, callback=None, wait=False,
334-
timeout=60)
333+
'message', data='data', namespace=None, callback=None)
335334

336335
def test_call(self):
337336
c = client.Client()

0 commit comments

Comments
 (0)