invoke_long_callback() function
Invoke a long-running user callback.
Long-running callbacks are run in a separate thread to not block the application itself.
This function expects to be provided a function to run in the background (in user_function).
It can also be specified a status function that is called when the operation performed by
user_function is finished (successfully or not), or periodically (using the period parameter).
See the User Manual section on Long Running Callbacks for details on when and how this function can be used.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
State
|
The |
required |
|
Callable[[...], None]
|
The function that will be run independently of Taipy GUI. Note that this function must not use state, which is not persisted across threads. |
required |
|
Optional[List | Tuple]
|
The arguments to send to user_function. |
None
|
|
Optional(Callable[[State, bool, ...], None]
|
The optional user-defined status function that is invoked at the end of and possibly during the runtime of user_function:
|
None
|
|
Optional[List | Tuple]
|
The remaining arguments of the user status function. |
None
|
|
int
|
The interval, in milliseconds, at which user_status_function is called. |
0
|