本文整理匯總了Java中org.apache.thrift7.server.TThreadPoolServer類的典型用法代碼示例。如果您正苦於以下問題:Java TThreadPoolServer類的具體用法?Java TThreadPoolServer怎麽用?Java TThreadPoolServer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TThreadPoolServer類屬於org.apache.thrift7.server包,在下文中一共展示了TThreadPoolServer類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getServer
import org.apache.thrift7.server.TThreadPoolServer; //導入依賴的package包/類
@Override
public TServer getServer(int port, TProcessor processor)
throws IOException, TTransportException {
TTransportFactory serverTransportFactory = getServerTransportFactory();
// define THsHaServer args
// original: THsHaServer + TNonblockingServerSocket
// option: TThreadPoolServer + TServerSocket
TServerSocket serverTransport = new TServerSocket(port);
TThreadPoolServer.Args server_args = new TThreadPoolServer.Args(
serverTransport).processor(new TUGIWrapProcessor(processor))
.minWorkerThreads(64).maxWorkerThreads(64)
.protocolFactory(new TBinaryProtocol.Factory());
if (serverTransportFactory != null)
server_args.transportFactory(serverTransportFactory);
// construct THsHaServer
return new TThreadPoolServer(server_args);
}
示例2: getServer
import org.apache.thrift7.server.TThreadPoolServer; //導入依賴的package包/類
public TServer getServer(int port, TProcessor processor)
throws IOException, TTransportException {
TTransportFactory serverTransportFactory = getServerTransportFactory();
// define THsHaServer args
// original: THsHaServer + TNonblockingServerSocket
// option: TThreadPoolServer + TServerSocket
TServerSocket serverTransport = new TServerSocket(port);
TThreadPoolServer.Args server_args = new TThreadPoolServer.Args(
serverTransport).processor(new TUGIWrapProcessor(processor))
.minWorkerThreads(64).maxWorkerThreads(64)
.protocolFactory(new TBinaryProtocol.Factory());
if (serverTransportFactory != null)
server_args.transportFactory(serverTransportFactory);
// construct THsHaServer
return new TThreadPoolServer(server_args);
}