1 from time import time as now
2 from ckmodule import AbstractProtocol, AbstractBus, AbstractNodeAdaptor, MissingModule
3
4
5
6
7
8 NID_CLASS = {}
9
11 """abstract superclass of all Protocol classes
12
13 AbstractProtocol subclasses must implement the following methods:
14 p.update()
15 p.hintNodes(nodes)
16 p.generatePNA( nid )
17
18 AbstractProtocol instances must have the following data attributes:
19 p.heartbeats -- dict -- nid to last heartbeat
20 """
24
27
29 self._ts = [now(),"No message"]
30 h = {}
31 for nd in nodes:
32 h[nd] = self._ts
33 self.heartbeats = h
34
37
38 -class Bus( AbstractBus ):
39 """abstract superclass of all Bus classes
40
41 """
44
46 """abstract superclass of all ProtocolNodeAdaptor classes
47
48 AbstractNodeAdaptor subclasses must implement the get_typecode()
49 method, returning the module's type identification string
50 """
54
58