check if source is connected before adding callback
This commit is contained in:
@ -4,6 +4,9 @@ from ..cache import Cache
|
||||
class CachedSource:
|
||||
|
||||
def __init__(self, size=1):
|
||||
if not self.is_connected:
|
||||
raise RuntimeError(f"{self.pvname} is not connected, cannot attach cache")
|
||||
|
||||
self.cache = cache = Cache(size=size)
|
||||
self._cb = self.add_callback(cache.callback_append, with_ctrlvars=False)
|
||||
|
||||
@ -12,7 +15,3 @@ class CachedSource:
|
||||
|
||||
|
||||
|
||||
#TODO: check if source is connected before adding callback
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user