class EphemeralPeerRepository : PeerRepository
(source)
An in-memory peer repository.
Note: as the storage is in-memory, no retrieval methods in this implementation will suspend.
<init> |
An in-memory peer repository. EphemeralPeerRepository(peers: MutableMap<PublicKey, Peer> = ConcurrentHashMap()) |
addListener |
Adds a listener to the repository, which will consume peer entries whenever they are added to the repository. fun addListener(listener: (Peer) -> Unit): Unit |
get |
Get a peer from node ID and endpoint information fun get(nodeId: PublicKey, endpoint: Endpoint): Peer
Get a Peer based on a URI components. suspend fun get(host: String, port: Int, nodeId: PublicKey): Peer
Get a Peer based on a URI. suspend fun get(uri: URI): Peer |
getAsync |
Get a Peer based on a URI. fun getAsync(uri: URI): AsyncResult<Peer>
Get a Peer based on a URI string. fun getAsync(uri: String): AsyncResult<Peer> |