|
53 | 53 | def setup_local(myName: str, virtualNet: SocketsConfig, classicalNet: SocketsConfig, |
54 | 54 | lNode: pb.Root, func: Callable, *args, **kwargs): |
55 | 55 | """ |
56 | | - Sets up |
57 | | - - local classical communication server (if desired according to the configuration file) |
58 | | - - client connection to the local virtual node quantum backend |
59 | | - - client connections to all other classical communication servers |
60 | | -
|
61 | | - Arguments |
62 | | - myName name of this node (string) |
63 | | - virtualNet servers of the virtual nodes (dictionary of host objects) |
64 | | - classicalNet servers on the classical communication network (dictionary of host objects) |
65 | | - lNode Twisted PB root to use as local server (if applicable) |
66 | | - func function to run if all connections are set up |
67 | | - args, kwargs additional arguments to be given to func |
| 56 | + Sets up a local classical communication server (if desired according to the configuration file), |
| 57 | + a client connection to the local virtual node quantum backend and a client connections to all other |
| 58 | + classical communication servers |
| 59 | +
|
| 60 | + Args: |
| 61 | + myName (str): |
| 62 | + name of this node |
| 63 | + virtualNet (SocketsConfig): |
| 64 | + servers of the virtual nodes (dictionary of host objects) |
| 65 | + classicalNet (SocketsConfig): |
| 66 | + servers on the classical communication network (dictionary of host objects) |
| 67 | + lNode (pb.Root): |
| 68 | + Twisted PB root to use as local server (if applicable) |
| 69 | + func (Callable): |
| 70 | + function to run if all connections are set up |
| 71 | + *args (Any): |
| 72 | + additional arguments to be given to ``func`` |
| 73 | + **kwargs (Any): |
| 74 | + additional keyword-based arguments to be passed to ``func`` |
68 | 75 | """ |
69 | 76 |
|
70 | 77 | # Initialize Twisted callback framework |
@@ -120,10 +127,11 @@ def setup_local(myName: str, virtualNet: SocketsConfig, classicalNet: SocketsCon |
120 | 127 | # |
121 | 128 |
|
122 | 129 |
|
123 | | -def init_register(resList, myName, virtualNet, classicalNet, lNode, func, *args, **kwargs): |
| 130 | +def init_register(resList: DeferredList, myName: str, virtualNet: SocketsConfig, classicalNet: SocketsConfig, |
| 131 | + lNode: pb.Root, func: Callable, *args, **kwargs): |
124 | 132 | _logger.debug("LOCAL %s: All connections set up.", myName) |
125 | 133 |
|
126 | | - # Retrieve the connection to the local virtual node, if successfull |
| 134 | + # Retrieve the connection to the local virtual node, if successful |
127 | 135 | j = 0 |
128 | 136 | if resList[j][0]: |
129 | 137 | virtRoot = resList[j][1] |
|
0 commit comments