Skip to content

Commit 4f5bf1e

Browse files
Improve documentation on start_background_task() function
1 parent 67aa7cd commit 4f5bf1e

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

src/socketio/asyncio_client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,7 @@ def start_background_task(self, target, *args, **kwargs):
311311
:param args: arguments to pass to the function.
312312
:param kwargs: keyword arguments to pass to the function.
313313
314-
This function returns an object compatible with the `Thread` class in
315-
the Python standard library. The `start()` method on this object is
316-
already called by this function.
314+
The return value is a ``asyncio.Task`` object.
317315
"""
318316
return self.eio.start_background_task(target, *args, **kwargs)
319317

src/socketio/asyncio_server.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,6 @@ def start_background_task(self, target, *args, **kwargs):
396396
:param kwargs: keyword arguments to pass to the function.
397397
398398
The return value is a ``asyncio.Task`` object.
399-
400-
Note: this method is a coroutine.
401399
"""
402400
return self.eio.start_background_task(target, *args, **kwargs)
403401

src/socketio/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,9 +500,9 @@ def start_background_task(self, target, *args, **kwargs):
500500
:param args: arguments to pass to the function.
501501
:param kwargs: keyword arguments to pass to the function.
502502
503-
This function returns an object compatible with the `Thread` class in
504-
the Python standard library. The `start()` method on this object is
505-
already called by this function.
503+
This function returns an object that represents the background task,
504+
on which the ``join()`` methond can be invoked to wait for the task to
505+
complete.
506506
"""
507507
return self.eio.start_background_task(target, *args, **kwargs)
508508

src/socketio/server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,9 @@ def start_background_task(self, target, *args, **kwargs):
599599
:param args: arguments to pass to the function.
600600
:param kwargs: keyword arguments to pass to the function.
601601
602-
This function returns an object compatible with the `Thread` class in
603-
the Python standard library. The `start()` method on this object is
604-
already called by this function.
602+
This function returns an object that represents the background task,
603+
on which the ``join()`` methond can be invoked to wait for the task to
604+
complete.
605605
"""
606606
return self.eio.start_background_task(target, *args, **kwargs)
607607

0 commit comments

Comments
 (0)