我有以下代码可以启动一个 thrift java 服务器:
public class Server {
public static void StartsimpleServer(GameService.Processor<GameServiceHandler> processor) {
try {
TServerTransport serverTransport = new TServerSocket(9090);
TServer server = new TThreadPoolServer(new
TThreadPoolServer.Args(serverTransport).processor(processor));
System.out.println("Starting the multi thread server...");
server.serve();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
StartsimpleServer(new GameService.Processor<>( new GameServiceHandler()));
}
}
我想设置最大线程数和其他与线程相关的设置。我怎样才能做到这一点?我找不到任何与此相关的文档。