MCPcopy Create free account
hub / github.com/LabPy/lantz / refresh_async

Method refresh_async

lantz/driver.py:427–443  ·  view source on GitHub ↗

Asynchronous refresh cache by reading values from the instrument. :param keys: a string or list of strings with the properties to refresh Default None, meaning all properties. If keys is a string, returns the value. If keys is a

(self, keys=None, *, callback=None)

Source from the content-addressed store, hash-verified

425 return {key: getattr(self, key) for key in self._lantz_features}
426
427 def refresh_async(self, keys=None, *, callback=None):
428 """Asynchronous refresh cache by reading values from the instrument.
429
430 :param keys: a string or list of strings with the properties to refresh
431 Default None, meaning all properties.
432 If keys is a string, returns the value.
433 If keys is a list, returns a dictionary.
434 :type keys: str or list or tuple or dict
435
436 :return type: concurrent.future.
437
438
439 """
440 fut = self._submit(self.refresh, keys=keys)
441 if not callback is None:
442 fut.add_done_callback(callback)
443 return fut
444
445 def recall(self, keys=None):
446 """Return the last value seen for a feat or a collection of feats.

Callers 1

test_refresh_asyncMethod · 0.80

Calls

no outgoing calls

Tested by 1

test_refresh_asyncMethod · 0.64