Documentation
¶
Index ¶
- type ConnectionPool
- func (cp *ConnectionPool) GetConnection(address string, remotePub crypto.PublicKey) (net.Connection, error)
- func (cp *ConnectionPool) GetConnectionIfExists(remotePub crypto.PublicKey) (net.Connection, error)
- func (cp *ConnectionPool) RemoteConnectionsChannel() chan net.NewConnectionEvent
- func (cp *ConnectionPool) Shutdown()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionPool ¶
type ConnectionPool struct {
// contains filtered or unexported fields
}
ConnectionPool stores all net.Connections and make them available to all users of net.Connection. There are two sources of connections - - Local connections that were created by local node (by calling GetConnection) - Remote connections that were provided by a networker impl. in a pub-sub manner
func NewConnectionPool ¶
func NewConnectionPool(network networker, lPub crypto.PublicKey) *ConnectionPool
NewConnectionPool creates new ConnectionPool
func (*ConnectionPool) GetConnection ¶
func (cp *ConnectionPool) GetConnection(address string, remotePub crypto.PublicKey) (net.Connection, error)
GetConnection fetchs or creates if don't exist a connection to the address which is associated with the remote public key
func (*ConnectionPool) GetConnectionIfExists ¶
func (cp *ConnectionPool) GetConnectionIfExists(remotePub crypto.PublicKey) (net.Connection, error)
GetConnectionIfExists checks if the connection is exists or pending
func (*ConnectionPool) RemoteConnectionsChannel ¶
func (cp *ConnectionPool) RemoteConnectionsChannel() chan net.NewConnectionEvent
RemoteConnectionsChannel is a channel that we send processed connections on
func (*ConnectionPool) Shutdown ¶
func (cp *ConnectionPool) Shutdown()
Shutdown of the ConnectionPool, gracefully. - Close all open connections - Waits for all Dial routines to complete and unblock any routines waiting for GetConnection