AFL.automation.shared.ServerDiscovery#
Classes
|
Event loop browser that fires ServiceListener callbacks as services of the requested types appear, change, and disappear. |
|
An async version of ServiceInfo. |
|
Awaitable facade over Zeroconf for registration, browsing, and resolution; expects a running asyncio event loop. |
|
An async version of ZeroconfServiceTypes. |
|
|
|
|
ServerDiscovery class |
|
|
Threaded browser that fires ServiceListener callbacks as services of the requested types appear, change, and disappear. |
|
Everything known about a single service instance. |
|
|
|
High level mDNS service discovery: register services, browse for them, and resolve their details on the local network. |
- class AFL.automation.shared.ServerDiscovery.RunThread(coro)[source]#
- __init__(coro)[source]#
This constructor should always be called with keyword arguments. Arguments are:
group should be None; reserved for future extension when a ThreadGroup class is implemented.
target is the callable object to be invoked by the run() method. Defaults to None, meaning nothing is called.
name is the thread name. By default, a unique name is constructed of the form “Thread-N” where N is a small decimal number.
args is a list or tuple of arguments for the target invocation. Defaults to ().
kwargs is a dictionary of keyword arguments for the target invocation. Defaults to {}.
If a subclass overrides the constructor, it must make sure to invoke the base class constructor (Thread.__init__()) before doing anything else to the thread.
- run()[source]#
Method representing the thread’s activity.
You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.
- class AFL.automation.shared.ServerDiscovery.ServerDiscovery[source]#
ServerDiscovery class
This class is used to discover AFL servers on the network using zeroconf requests that match a particular specification.
- on_service_state_change(zeroconf: Zeroconf, service_type: str, name: str, state_change: ServiceStateChange) → None[source]#
- discover_server_by_name(service_name)[source]#
Does a zeroconf request to find a named AFL-automation server on the network.
Returns a tuple of
(hostname:port, ServiceInfo)when the service is found. If the service cannot be located anExceptionis raised.
- async classmethod sa_aio_discover_server_by_name(service_name)[source]#
Does a zeroconf request to find a named AFL-automation server on the network.
Returns a tuple of
(hostname:port, ServiceInfo)when the service is found. If the service cannot be located anExceptionis raised.
- classmethod sa_discover_server_by_name(service_name)[source]#
Does a zeroconf request to find a named AFL-automation server on the network.
Returns a tuple of (hostname:port string,ServiceInfo object) if found, None if not found.
- find_server_by_name(service_name)[source]#
Disambiguator for either matching or discovering a specific server by name
- match_server_by_name(service_name)[source]#
Looks through the registry of discovered services for an exact name match. Returns a tuple of (hostname:port string,ServiceInfo object) if found, None if not found.