abstract class Peer<T : StackService>
Interface for Golden Gate Nodes. Used to represent a connection and encapsulates the protocol
Peer(stackService: T, peerRole: PeerRole)
Interface for Golden Gate Nodes. Used to represent a connection and encapsulates the protocol |
val peerRole: PeerRole |
|
val stackService: T |
abstract fun connection(): Observable<PeerConnectionStatus>
Get a reference to the connection of the Peer. If the Peer is not yet connected, it will connect upon subscription. The returned Observable will be shared for all callers connection until the connection is lost or disconnected. A successive call after disconnected will return a new Observable. Disposing the returned Observable will NOT disconnect the connection. This method should be Synchronized with disconnect and close |
|
abstract fun disconnect(): Unit
Disconnects the Peer if currently connected. All subscribers of the current connection will have their disposables disposed. This method should be Synchronized with connection and close |
class StackPeer<T : StackService> : Peer<T>
A Peer (hub or node) that encapsulates a connection via a Stack including the StackConfig, StackService, Stack, and Bridge |