def handle(service)
      @run_mutex.synchronize do
        unless @running_state == :not_started
          fail 'cannot add services if the server has been started'
        end
        cls = service.is_a?(Class) ? service : service.class
        assert_valid_service_class(cls)
        add_rpc_descs_for(service)
      end
    end
def handle(service)
      @run_mutex.synchronize do
        unless @running_state == :not_started
          fail 'cannot add services if the server has been started'
        end
        cls = service.is_a?(Class) ? service : service.class
        assert_valid_service_class(cls)
        add_rpc_descs_for(service)
      end
    end
handle registration of classes

 service is either a class that includes GRPC::GenericService and whose
 #new function can be called without argument or any instance of such a
 class.

 E.g, after

 class Divider
   include GRPC::GenericService
   rpc :div DivArgs, DivReply    # single request, single response
   def initialize(optional_arg='default option') # no args
     ...
   end

 srv = GRPC::RpcServer.new(...)

 # Either of these works

 srv.handle(Divider)

 # or

 srv.handle(Divider.new('replace optional arg'))

 It raises RuntimeError:
 - if service is not valid service class or object
 - its handler methods are already registered
 - if the server is already running

 @param service [Object|Class] a service class or object as described
        above