re-use bsread.Source docstring for BSCache

This commit is contained in:
2025-02-11 21:05:42 +01:00
parent 90b55ef277
commit e5dbf22676

View File

@ -1,4 +1,4 @@
from bsread import source, dispatcher from bsread import dispatcher, source, Source
from bsread import BIND, CONNECT, PUSH, PULL, PUB, SUB # make these easier to access from bsread import BIND, CONNECT, PUSH, PULL, PUB, SUB # make these easier to access
from .bsvar import BSVar from .bsvar import BSVar
@ -130,6 +130,14 @@ class BSCache:
BSCache.__doc__ = f"""
maxsize: Size of the queue between main and receiving thread.
kwargs are forwarded to bsread.source:{Source.__init__.__doc__}
"""
def check_availability(name): def check_availability(name):
if not is_available(name): if not is_available(name):
raise ValueError(f"channel {name} is not available") raise ValueError(f"channel {name} is not available")