public interface RemotingServer extends RemotingService
| 限定符和类型 | 方法和说明 |
|---|---|
void |
invokeAsync(io.netty.channel.Channel channel,
RemotingCommand request,
long timeoutMillis,
InvokeCallback invokeCallback) |
void |
invokeOneway(io.netty.channel.Channel channel,
RemotingCommand request,
long timeoutMillis) |
RemotingCommand |
invokeSync(io.netty.channel.Channel channel,
RemotingCommand request,
long timeoutMillis) |
int |
localListenPort()
服务器绑定的本地端口
PORT
|
void |
registerDefaultProcessor(NettyRequestProcessor processor,
ExecutorService executor) |
void |
registerProcessor(int requestCode,
NettyRequestProcessor processor,
ExecutorService executor)
注册请求处理器,ExecutorService必须要对应一个队列大小有限制的阻塞队列,防止OOM
requestCode
processor
executor
|
registerRPCHook, shutdown, startvoid registerProcessor(int requestCode,
NettyRequestProcessor processor,
ExecutorService executor)
void registerDefaultProcessor(NettyRequestProcessor processor, ExecutorService executor)
int localListenPort()
RemotingCommand invokeSync(io.netty.channel.Channel channel, RemotingCommand request, long timeoutMillis) throws InterruptedException, RemotingSendRequestException, RemotingTimeoutException
void invokeAsync(io.netty.channel.Channel channel,
RemotingCommand request,
long timeoutMillis,
InvokeCallback invokeCallback)
throws InterruptedException,
RemotingTooMuchRequestException,
RemotingTimeoutException,
RemotingSendRequestException
void invokeOneway(io.netty.channel.Channel channel,
RemotingCommand request,
long timeoutMillis)
throws InterruptedException,
RemotingTooMuchRequestException,
RemotingTimeoutException,
RemotingSendRequestException
Copyright © 2018. All rights reserved.