站点更新:2019-12-12 17:59:40
This commit is contained in:
@@ -1,29 +1,29 @@
|
||||
package me.ehlxr;
|
||||
|
||||
import cn.ceres.did.client.SdkClient;
|
||||
import cn.ceres.did.sdk.SdkProto;
|
||||
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
/**
|
||||
* @author ehlxr
|
||||
*/
|
||||
public class DidSdkTest {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
SdkClient client = new SdkClient("10.19.248.200", 30581);
|
||||
// SdkClient client = new SdkClient();
|
||||
client.init();
|
||||
client.start();
|
||||
|
||||
// client.invokeOneWay(new SdkProto(), 2000);
|
||||
// System.out.println(client.invokeSync(new SdkProto(), 2000).getDid());
|
||||
CountDownLatch countDownLatch = new CountDownLatch(1);
|
||||
client.invokeAsync(new SdkProto(), 2000, responseFuture -> {
|
||||
System.out.println(responseFuture.getSdkProto().getDid());
|
||||
countDownLatch.countDown();
|
||||
});
|
||||
countDownLatch.await();
|
||||
client.shutdown();
|
||||
}
|
||||
}
|
||||
//
|
||||
// import cn.ceres.did.client.SdkClient;
|
||||
// import cn.ceres.did.sdk.SdkProto;
|
||||
//
|
||||
// import java.util.concurrent.CountDownLatch;
|
||||
//
|
||||
// /**
|
||||
// * @author ehlxr
|
||||
// */
|
||||
// public class DidSdkTest {
|
||||
//
|
||||
// public static void main(String[] args) throws Exception {
|
||||
// SdkClient client = new SdkClient("10.19.248.200", 30581);
|
||||
// // SdkClient client = new SdkClient();
|
||||
// client.init();
|
||||
// client.start();
|
||||
//
|
||||
// // client.invokeOneWay(new SdkProto(), 2000);
|
||||
// // System.out.println(client.invokeSync(new SdkProto(), 2000).getDid());
|
||||
// CountDownLatch countDownLatch = new CountDownLatch(1);
|
||||
// client.invokeAsync(new SdkProto(), 2000, responseFuture -> {
|
||||
// System.out.println(responseFuture.getSdkProto().getDid());
|
||||
// countDownLatch.countDown();
|
||||
// });
|
||||
// countDownLatch.await();
|
||||
// client.shutdown();
|
||||
// }
|
||||
// }
|
||||
|
@@ -1,15 +0,0 @@
|
||||
package me.ehlxr
|
||||
|
||||
/**
|
||||
* Created by lixiangrong on 2018/8/17.
|
||||
*/
|
||||
fun main(args: Array<String>) {
|
||||
val strList = listOf("a", "ab", "abc","abcd","abcde","abcdef","abcdefg")
|
||||
// 非常好用的流式 API filter,flat,map 等等
|
||||
strList.forEach{str->
|
||||
run {
|
||||
str.length
|
||||
println(str)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user