func (su *StorageUnit) Cmd(cmd Command) (interface{}, error) {
	cmdb := &CommandBundle{cmd, make(chan *CommandRet)}
	select {
	case su.cmdCh <- cmdb:
	case <-time.After(10 * time.Second):
		gslog.Errorf("send command %s:%s timeout", su.ConnType, su.Addr)
		return nil, errors.New("timeout")
	}

	select {
	case cret := <-cmdb.RetCh:
		return cret.Ret, cret.Err
	case <-time.After(10 * time.Second):
		gslog.Errorf("receive response %s:%s timeout", su.ConnType, su.Addr)
		return nil, errors.New("timeout")
	}
}
// Cmd takes in a command bundle and performs the command in one of the
// Storage's connections
Cmd takes in a command bundle and performs the command in one of the
Storage's connections
// Cmd takes in a command bundle and performs the command in one of the // Storage ' s connections
func (su *StorageUnit) Cmd(cmd Command) (interface{}, error) {
	cmdb := &CommandBundle{cmd, make(chan *CommandRet)}
	select {
	case su.cmdCh <- cmdb:
	case <-time.After(10 * time.Second):
		gslog.Errorf("send command %s:%s timeout", su.ConnType, su.Addr)
		return nil, errors.New("timeout")
	}
	select {
	case cret := <-cmdb.RetCh:
		return cret.Ret, cret.Err
	case <-time.After(10 * time.Second):
		gslog.Errorf("receive response %s:%s timeout", su.ConnType, su.Addr)
		return nil, errors.New("timeout")
	}
}
func ( su * StorageUnit ) Cmd ( cmd Command ) ( interface { } , error ) { cmdb := & CommandBundle { cmd , make ( chan * CommandRet ) } select { case su . cmdCh <- cmdb : case <- time . After ( 10 * time . Second ) : gslog . Errorf ( " " , su . ConnType , su . Addr ) return nil , errors . New ( " " ) } select { case cret := <- cmdb . RetCh : return cret . Ret , cret . Err case <- time . After ( 10 * time . Second ) : gslog . Errorf ( " " , su . ConnType , su . Addr ) return nil , errors . New ( " " ) } }
Cmd takes in a command bundle and performs the command in one of the
Storage's connections
Cmd takes in a command bundle and performs the command in one of the Storage ' s connections