func (r *RouterRPC) MGet(arg *proto.MGetArg, reply *proto.MGetReply) error { var ( i int userId int64 session *proto.GetReply ) reply.Sessions = make([]*proto.GetReply, 0, len(arg.UserIds)) for i = 0; i < len(arg.UserIds); i++ { userId = arg.UserIds[i] seqs, servers := r.bucket(userId).Get(userId) session = new(proto.GetReply) session.Seqs = seqs session.Servers = servers reply.Sessions[i] = session } return nil }
func (r *RouterRPC) Get(arg *proto.GetArg, reply *proto.GetReply) error { seqs, servers := r.bucket(arg.UserId).Get(arg.UserId) reply.Seqs = seqs reply.Servers = servers return nil }