RobotRaconteurCompanion.Util.RobustFunctionCaller

Utility class to robustly call a function periodically and poll for results

RobustFunctionCaller

class RobotRaconteurCompanion.Util.RobustFunctionCaller.RobustPollingAsyncFunctionCaller(f, f_args, retry_backoff=1, max_retry_attempts=10, poll_interval=30, call_timeout=1, error_handler=None, node=None, client_obj=None)

Class to call function that is polled periodically, or when requested

Parameters:
  • f (callable) – The function to call

  • f_args (list) – The arguments to pass to the function

  • retry_backoff (float) – The time to wait before retrying a failed call

  • max_retry_attempts (int) – The maximum number of retry attempts

  • poll_interval (float) – The polling interval in seconds

  • call_timeout (float) – The timeout for the function call

  • error_handler (callable) – The error handler to call if the function call fails

  • node (RobotRaconteur.RobotRaconteurNode) – (optional) The Robot Raconteur node to use for parsing. Defaults to RobotRaconteurNode.s

  • client_obj (RobotRaconteur.ClientObject) – (optional) The client object to use for finding types. Defaults to None

close()

Close the polling function caller

property poll_data

Returns the current polled data

request_poll()

Call to request a poll