MCPcopy Create free account
hub / github.com/miguelgrinberg/python-socketio / start_background_task

Method start_background_task

src/socketio/client.py:329–344  ·  view source on GitHub ↗

Start a background task using the appropriate async model. This is a utility function that applications can use to start a background task using the method that is compatible with the selected async mode. :param target: the target function to execute. :param

(self, target, *args, **kwargs)

Source from the content-addressed store, hash-verified

327 self._reconnect_task.join()
328
329 def start_background_task(self, target, *args, **kwargs):
330 """Start a background task using the appropriate async model.
331
332 This is a utility function that applications can use to start a
333 background task using the method that is compatible with the
334 selected async mode.
335
336 :param target: the target function to execute.
337 :param args: arguments to pass to the function.
338 :param kwargs: keyword arguments to pass to the function.
339
340 This function returns an object that represents the background task,
341 on which the ``join()`` methond can be invoked to wait for the task to
342 complete.
343 """
344 return self.eio.start_background_task(target, *args, **kwargs)
345
346 def sleep(self, seconds=0):
347 """Sleep for the requested amount of time using the appropriate async

Callers 15

initializeMethod · 0.45
admin_connectMethod · 0.45
_trigger_eventMethod · 0.45
_handle_eio_connectMethod · 0.45
initializeMethod · 0.45
admin_connectMethod · 0.45
_trigger_eventMethod · 0.45
_handle_eio_connectMethod · 0.45
rMethod · 0.45

Calls

no outgoing calls

Tested by 4

rMethod · 0.36
test_connectFunction · 0.36