站点更新:2019-12-12 17:59:40

This commit is contained in:
2019-12-12 17:59:40 +08:00
parent 84159a12e2
commit 1759c923ec
5 changed files with 34 additions and 49 deletions

View File

@@ -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();
// }
// }

View File

@@ -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 filterflatmap 等等
strList.forEach{str->
run {
str.length
println(str)
}
}
}