Package brisa :: Package core :: Module threaded_call
[hide private]
[frames] | no frames]

Module threaded_call

source code

Runs a call asynchronously and forwards the result/error to specified callbacks.

Classes [hide private]
  ThreadedCall
This class runs a call asynchronously and forwards the result/error to specified callbacks.
Functions [hide private]
 
run_async_function(f, param_tuple=(), delay=0)
Calls a function passing a parameters tuple.
source code
ThreadedCall
run_async_call(function, success_callback=None, error_callback=None, success_callback_cargo=None, error_callback_cargo=None, delay=0, *args, **kwargs)
Interface for running an asynchronous call.
source code
Function Details [hide private]

run_async_function(f, param_tuple=(), delay=0)

source code 

Calls a function passing a parameters tuple. Note that this function returns nothing. If you want an asynchronous call with a monitor object, see brisa.core.threaded_call.run_async_call and brisa.core.threaded_call.ThreadedCall.

Parameters:
  • f - function to be called
  • param_tuple - tuple param for the function
  • delay - wait time before calling the function

run_async_call(function, success_callback=None, error_callback=None, success_callback_cargo=None, error_callback_cargo=None, delay=0, *args, **kwargs)

source code 

Interface for running an asynchronous call.

Parameters:
  • function (callable) - function to be called passing *args and **kwargs
  • success_callback (callable) - called in case of success, receives call result
  • error_callback (callable) - called in case of error, receives call result
  • success_callback_cargo - success callback additional parameters
  • error_callback_cargo - error callback additional parameters
  • delay (float) - time to be wait before performing the call
  • args - arguments to the function
  • kwargs - arguments to the function
Returns: ThreadedCall
object for monitoring the call