inmem_transport.go
func (i *InmemTransport) Disconnect(peer ServerAddress) {
	i.Lock()
	defer i.Unlock()
	delete(i.peers, peer)

	// Disconnect any pipelines
	n := len(i.pipelines)
	for idx := 0; idx < n; idx++ {
		if i.pipelines[idx].peerAddr == peer {
			i.pipelines[idx].Close()
			i.pipelines[idx], i.pipelines[n-1] = i.pipelines[n-1], nil
			idx--
			n--
		}
	}
	i.pipelines = i.pipelines[:n]
}
func (i *InmemTransport) Disconnect(peer ServerAddress) {
	i.Lock()
	defer i.Unlock()
	delete(i.peers, peer)

	// Disconnect any pipelines
	n := len(i.pipelines)
	for idx := 0; idx < n; idx++ {
		if i.pipelines[idx].peerAddr == peer {
			i.pipelines[idx].Close()
			i.pipelines[idx], i.pipelines[n-1] = i.pipelines[n-1], nil
			idx--
			n--
		}
	}
	i.pipelines = i.pipelines[:n]
}
func ( i * InmemTransport ) Disconnect ( peer ServerAddress ) { i . Lock ( ) defer i . Unlock ( ) delete ( i . peers , peer ) // Disconnect any pipelines n := len ( i . pipelines ) for idx := 0 ; idx < n ; idx ++ { if i . pipelines [ idx ] . peerAddr == peer { i . pipelines [ idx ] . Close ( ) i . pipelines [ idx ] , i . pipelines [ n - 1 ] = i . pipelines [ n - 1 ] , nil idx -- n -- } } i . pipelines = i . pipelines [ : n ] }
// Disconnect is used to remove the ability to route to a given peer.
Disconnect is used to remove the ability to route to a given peer .