class_docstr: Invokes a gRPC method on multiple endpoints in parallel.
  This class aims to call gRPC methods without conversions between proto and python object.
  TensorParallelClient can be used for invocation with the conversions.
class_docstr_tok: ["Invokes","a","gRPC","method","on","multiple","endpoints","in","parallel",".","This","class","aims","to","call","gRPC","methods","without","conversions","between","proto","and","python","object",".","TensorParallelClient","can","be","used","for","invocation","with","the","conversions","."]
code: def invoke(self, method_name, proto_request):
      # This is needed because gRPC calls from interceptor are launched from
      return asyncio.run_coroutine_threadsafe(
          self._invoke_async(method_name, proto_request),
          self.asyncio_loop,
      ).result()
  
imports: import asyncio
  from concurrent import futures
  import logging
  import grpc
  from google.protobuf import empty_pb2
  from .proto import legacymodelresponse_pb2_grpc
  import sys
  import threading
  import time
  from mii.legacy.constants import GRPC_MAX_MSG_SIZE, CREATE_SESSION_METHOD, DESTROY_SESSION_METHOD, TERMINATE_METHOD, LB_MAX_WORKER_THREADS, SERVER_SHUTDOWN_TIMEOUT, TaskType
  from mii.legacy.method_table import GRPC_METHOD_TABLE
  from mii.legacy.client import create_channel
  from mii.legacy.utils import unpack_proto_query_kwargs
label_desc: Use image node_id 2 for calling the ParallelStubInvoker obj's underlying member method code with example usage: obj.invoke(method_name, proto_request) and returns: asyncio