libgs.monitoring.Monitor.to_gen_in_executor

Monitor.to_gen_in_executor(fn, point_names, *args, **kwargs)[source]

This decorator will take any function and turn it into a generator appropriately formatted for adding using register_monitor().

The call to fn is being delegated to an executor, and while it is not done, calls to next() will return None, otherwise it will return a tuple containging:

  • The timestamp the data the return value of fn
  • Any Exceptions that occurred
  • The return value

This is the format that is required in order to add it to the Monitor.