func (t *Task) LenAvailablePeers() int {
	var len int
	t.Peers.Range(func(_, v interface{}) bool {
		peer, ok := v.(*Peer)
		if !ok {
			return true
		}

		if peer.FSM.Is(PeerStateLeave) {
			return true
		}

		len++
		return true
	})

	return len
}
// LenAvailablePeers return length of peers without state is PeerStateLeave
LenAvailablePeers return length of peers without state is PeerStateLeave
// LenAvailablePeers return length of peers without state is PeerStateLeave
func (t *Task) LenAvailablePeers() int {
	var len int
	t.Peers.Range(func(_, v interface{}) bool {
		peer, ok := v.(*Peer)
		if !ok {
			return true
		}
		if peer.FSM.Is(PeerStateLeave) {
			return true
		}
		len++
		return true
	})
	return len
}
func ( t * Task ) LenAvailablePeers ( ) int { var len int t . Peers . Range ( func ( _ , v interface { } ) bool { peer , ok := v . ( * Peer ) if ! ok { return true } if peer . FSM . Is ( PeerStateLeave ) { return true } len ++ return true } ) return len }
LenAvailablePeers return length of peers without state is PeerStateLeave
LenAvailablePeers return length of peers without state is PeerStateLeave