This is an automated email from the ASF dual-hosted git repository. toulmean pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-tuweni.git
The following commit(s) were added to refs/heads/master by this push: new 36c579f Add javadoc new ef737ec Merge pull request #230 from atoulme/add_javadoc 36c579f is described below commit 36c579fb1b57a586cf018dc3d62a9e9747892814 Author: Antoine Toulme <anto...@lunar-ocean.com> AuthorDate: Sat May 1 23:43:08 2021 -0700 Add javadoc --- .../tuweni/ethclient/EthereumPeerRepository.kt | 34 ++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/eth-client/src/main/kotlin/org/apache/tuweni/ethclient/EthereumPeerRepository.kt b/eth-client/src/main/kotlin/org/apache/tuweni/ethclient/EthereumPeerRepository.kt index 8885c81..2d7885a 100644 --- a/eth-client/src/main/kotlin/org/apache/tuweni/ethclient/EthereumPeerRepository.kt +++ b/eth-client/src/main/kotlin/org/apache/tuweni/ethclient/EthereumPeerRepository.kt @@ -27,20 +27,50 @@ import java.util.UUID import java.util.concurrent.ConcurrentHashMap import java.util.stream.Stream +/** + * A peer repository of peers implementing the eth subprotocol. + */ interface EthereumPeerRepository : PeerRepository { + /** + * Stores the status message sent for a connection + * @param connId the ID of the connection + * @param status the status message + */ fun storeStatus(connId: String, status: Status) + /** + * Provides a stream of active connections. + * + * @return a stream of active connections + */ fun activeConnections(): Stream<EthereumConnection> + /** + * Adds a listener to be called when a status message is received + * @param statusListener the listener + * @return a listener ID + */ fun addStatusListener(statusListener: (EthereumConnection) -> Unit): String + /** + * Removes a status listener + * @param id the listener identifier + */ fun removeStatusListener(id: String) + + /** + * Adds a listener to be called when a new peer connects + * @param identityListener the listener + * @return a listener ID + */ fun addIdentityListener(identityListener: (Identity) -> Unit): String + /** + * Removes an identity listener + * @param id the listener identifier + */ fun removeIdentityListener(id: String) } -interface EthereumPeer : Peer - interface EthereumConnection : Connection { fun status(): Status? } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@tuweni.apache.org For additional commands, e-mail: commits-h...@tuweni.apache.org