Skip to content

Commit

Permalink
Improve documentation on start_background_task() function
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Oct 15, 2021
1 parent 67aa7cd commit 4f5bf1e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
4 changes: 1 addition & 3 deletions src/socketio/asyncio_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,7 @@ def start_background_task(self, target, *args, **kwargs):
:param args: arguments to pass to the function.
:param kwargs: keyword arguments to pass to the function.
This function returns an object compatible with the `Thread` class in
the Python standard library. The `start()` method on this object is
already called by this function.
The return value is a ``asyncio.Task`` object.
"""
return self.eio.start_background_task(target, *args, **kwargs)

Expand Down
2 changes: 0 additions & 2 deletions src/socketio/asyncio_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,6 @@ def start_background_task(self, target, *args, **kwargs):
:param kwargs: keyword arguments to pass to the function.
The return value is a ``asyncio.Task`` object.
Note: this method is a coroutine.
"""
return self.eio.start_background_task(target, *args, **kwargs)

Expand Down
6 changes: 3 additions & 3 deletions src/socketio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,9 @@ def start_background_task(self, target, *args, **kwargs):
:param args: arguments to pass to the function.
:param kwargs: keyword arguments to pass to the function.
This function returns an object compatible with the `Thread` class in
the Python standard library. The `start()` method on this object is
already called by this function.
This function returns an object that represents the background task,
on which the ``join()`` methond can be invoked to wait for the task to
complete.
"""
return self.eio.start_background_task(target, *args, **kwargs)

Expand Down
6 changes: 3 additions & 3 deletions src/socketio/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,9 @@ def start_background_task(self, target, *args, **kwargs):
:param args: arguments to pass to the function.
:param kwargs: keyword arguments to pass to the function.
This function returns an object compatible with the `Thread` class in
the Python standard library. The `start()` method on this object is
already called by this function.
This function returns an object that represents the background task,
on which the ``join()`` methond can be invoked to wait for the task to
complete.
"""
return self.eio.start_background_task(target, *args, **kwargs)

Expand Down

0 comments on commit 4f5bf1e

Please sign in to comment.