new rpc.Service(rpcImpl, requestDelimited, responseDelimited)
Constructs a new RPC service instance.
| Name | Type | Default | Description | 
|---|---|---|---|
rpcImpl | 
            
            
            RPCImpl | 
                
                    
                    
                        
                    
                
                 RPC implementation  | 
        |
requestDelimited | 
            
            
            boolean | false | 
                
                    
                        optional
                    
                    
                        
                    
                
                 Whether requests are length-delimited  | 
        
responseDelimited | 
            
            
            boolean | false | 
                
                    
                        optional
                    
                    
                        
                    
                
                 Whether responses are length-delimited  | 
        
Extends
Members
- 
    
requestDelimited { boolean }
 - 
    
    
Whether requests are length-delimited.
 - 
    
responseDelimited { boolean }
 - 
    
    
Whether responses are length-delimited.
 - 
    
rpcImpl { RPCImpl | null }
 - 
    
    
RPC implementation. Becomes
nullonce the service is ended. 
Methods
- 
    
inherited emit(evt, args){ this }
 - 
    
    
    
Emits an event by calling its listeners with the specified arguments.
Name Type Description evtstring Event name
args* repeatable Arguments
Returns:
Type Description this this - 
    
end(endedByRPC){ rpc.Service }
 - 
    
    
    
Ends this service and emits the
endevent.Name Type Default Description endedByRPCboolean false optional Whether the service has been ended by the RPC implementation.
Returns:
Type Description rpc.Service this - 
    
inherited off(evt, fn){ this }
 - 
    
    
    
Removes an event listener or any matching listeners if arguments are omitted.
Name Type Description evtstring optional Event name. Removes all listeners if omitted.
fnEventEmitterListener optional Listener to remove. Removes all listeners of
evtif omitted.Returns:
Type Description this this - 
    
inherited on(evt, fn, ctx){ this }
 - 
    
    
    
Registers an event listener.
Name Type Description evtstring Event name
fnEventEmitterListener Listener
ctx* optional Listener context
Returns:
Type Description this this - 
    
rpcCall(method, requestCtor, responseCtor, request, callback){ undefined }
 - 
    
    
    
Calls a service method through rpcImpl.
Name Type Description methodMethod | rpc.ServiceMethod.<TReq, TRes> Reflected or static method
requestCtorConstructor.<TReq> Request constructor
responseCtorConstructor.<TRes> Response constructor
requestTReq | Properties.<TReq> Request message or plain object
callbackrpc.ServiceMethodCallback.<TRes> Service callback
Returns:
Type Description undefined