bpod_core.ipc.ServiceIterator
- class bpod_core.ipc.ServiceIterator
Bases:
Iterator[ServiceEvent],AbstractContextManagerLazy iterator for service discovery events.
Monitors both local (IPC) and remote (Zeroconf/TCP) services, yielding
ServiceEventinstances as services appear and disappear. Local services are always preferred — if a service is reachable both via IPC and TCP, only the IPC address is yielded.Prefer
iter_services()over instantiating this class directly.- __init__(service_type, properties=None, timeout=10.0, poll_interval=1.0, *, local=True, remote=True) None
Initialize the ServiceIterator.
- Parameters:
service_type (
str) – The service type to discover, e.g.,'bpod'.properties (
dict, optional) – Dictionary of expected service properties to match.timeout (
floatorNone, default:10.0) – How many seconds to monitor. PassNoneto monitor indefinitely until the iterator is closed.poll_interval (
float, default:1.0) – How often to poll for local service changes, in seconds.local (
bool, default:True) – Whether to search for services on the local machine.remote (
bool, default:True) – Whether to also search for services on the network.
- Return type:
None