mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-24 13:05:11 +08:00
同步获取响应数据
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.jsowell.netty.rpc;
|
||||
|
||||
import com.jsowell.pile.rpc.RpcUtil;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class TestRpcClient {
|
||||
@@ -13,9 +15,9 @@ public class TestRpcClient {
|
||||
rpcRequest.setParam("参数1");
|
||||
|
||||
try {
|
||||
System.out.println("thread1发送请求");
|
||||
RpcResponse rpcResponse = RpcUtil.send(rpcRequest, 5, TimeUnit.SECONDS);
|
||||
System.out.println("thread1处理结果:" + rpcResponse);
|
||||
// System.out.println("thread1发送请求");
|
||||
// RpcResponse rpcResponse = RpcUtil.send(rpcRequest, 5, TimeUnit.SECONDS);
|
||||
// System.out.println("thread1处理结果:" + rpcResponse);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -29,9 +31,9 @@ public class TestRpcClient {
|
||||
rpcRequest2.setParam("参数2");
|
||||
|
||||
try {
|
||||
System.out.println("thread2发送请求");
|
||||
RpcResponse rpcResponse = RpcUtil.send(rpcRequest2, 2, TimeUnit.SECONDS);
|
||||
System.out.println("thread2处理结果:" + rpcResponse);
|
||||
// System.out.println("thread2发送请求");
|
||||
// RpcResponse rpcResponse = RpcUtil.send(rpcRequest2, 2, TimeUnit.SECONDS);
|
||||
// System.out.println("thread2处理结果:" + rpcResponse);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user