slacm.discovery module

Created on Sep 26, 2020

@author: esdev

class slacm.discovery.DiscoveryClient(context, service)[source]

Bases: object

Discovery service client - each component has a copy of this. Acts as the interface of the Component to the discovery service.

call(msg)[source]
get(key)[source]

Lookup the value belonging to the key in the discovery service. Wait until the lookup is successful.

set(key, value)[source]

Set the value for the key in the discovery service.

class slacm.discovery.DiscoveryService(context, interface, root_port=None)[source]

Bases: object

Discovery service class - instantiated by the App (on the root and peer nodes alike). Acts as the interface of the App to the discovery service.

call(msg)[source]
get(key)[source]
get_local_port()[source]
root()[source]
set(key, value)[source]
stop()[source]
class slacm.discovery.PeerServer(rootHostPort, peerPort, localPort)[source]

Bases: Thread

Peer discovery server thread - each host (root and peer alike) runs a copy of this. Peer nodes connect via the root node’s RootServer.

SLAM_DS_GET = 'g'
SLAM_DS_HALT = 'h'
SLAM_DS_SET = 's'
async peer()[source]
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 slacm.discovery.RootServer(port, interface)[source]

Bases: Thread

Root discovery server thread - runs in the ‘root’ app.

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.

stop()[source]