class NodeMapper
Maps a NodeKey to a Node. Uses a PeerBuilder to make the node if it does not exist or if the existing Node is different than expected
nodeMap
- a MutableMap mapping a NodeKey to a Node
fun <T : StackService, K : NodeKey<*>> get(nodeKey: K, peerBuilder: PeerBuilder<T, K>, forceRebuild: Boolean = false): Peer<*>
Tries to retrieve an existing Node with a NodeKey or builds one with the given PeerBuilder if it does not exist or the PeerBuilder does not build it. |
|
fun <K : NodeKey<*>> removeNode(nodeKey: K): Unit
Removes a Node from the map that has the specific NodeKey, this needs to be called when we close a Node as the existing one will be unusable |
val instance: NodeMapper |