AFL.automation.shared.ServerDiscovery#

Classes

AsyncServiceBrowser(zeroconf, type_[, ...])

Used to browse for a service for specific type(s).

AsyncServiceInfo

An async version of ServiceInfo.

AsyncZeroconf([interfaces, unicast, ...])

Implementation of Zeroconf Multicast DNS Service Discovery

AsyncZeroconfServiceTypes()

An async version of ZeroconfServiceTypes.

IPVersion(value[, names, module, qualname, ...])

RunThread(coro)

ServerDiscovery()

ServerDiscovery class

ServiceBrowser(zc, type_[, handlers, ...])

Used to browse for a service of a specific type.

ServiceInfo

Service information.

ServiceStateChange(value[, names, module, ...])

Zeroconf([interfaces, unicast, ip_version, ...])

Implementation of Zeroconf Multicast DNS Service Discovery

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.

__init__()[source]#
on_service_state_change(zeroconf: Zeroconf, service_type: str, name: str, state_change: ServiceStateChange) None[source]#
async manage_service_info_to_list(zeroconf, service_type, name, append_or_remove)[source]#
async get_service_info(zeroconf: Zeroconf, service_type: str, name: str) None[source]#
async aio_find_server_by_name(service_name)[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 an Exception is 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 an Exception is 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.

find_server_by_partial_name(service_name)[source]#

Looks through the registry of discovered services for a partial name match. Returns a tuple of (hostname:port string,ServiceInfo object) if found, None if not found.

find_server_by_property_match(property_name, property_value)[source]#

Looks through the registry of discovered services for a partial match in a property string. Returns a tuple of (hostname:port string,ServiceInfo object) if found, None if not found.