Skip to content

Commit ef4ae90

Browse files
Improve start_background_task example (Fixes #647)
1 parent d530850 commit ef4ae90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/client.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ start a custom background task::
277277
# do some background work here!
278278
pass
279279

280-
sio.start_background_task(my_background_task, 123)
280+
task = sio.start_background_task(my_background_task, 123)
281281

282282
The arguments passed to this method are the background function and any
283283
positional or keyword arguments to invoke the function with.
@@ -288,7 +288,7 @@ Here is the ``asyncio`` version::
288288
# do some background work here!
289289
pass
290290

291-
sio.start_background_task(my_background_task, 123)
291+
task = sio.start_background_task(my_background_task, 123)
292292

293293
Note that this function is not a coroutine, since it does not wait for the
294294
background function to end. The background function must be a coroutine.

0 commit comments

Comments
 (0)