本文整理了Java中com.yyc.grpc.contract.YycServiceGrpc
类的一些代码示例,展示了YycServiceGrpc
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YycServiceGrpc
类的具体详情如下:
包路径:com.yyc.grpc.contract.YycServiceGrpc
类名称:YycServiceGrpc
暂无
代码示例来源:origin: yeyincai/grpc-demo
@java.lang.Override public io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
METHOD_SAY_HELLO,
asyncUnaryCall(
new MethodHandlers<
com.google.protobuf.StringValue,
com.yyc.grpc.contract.SayHelloResponse>(
this, METHODID_SAY_HELLO)))
.build();
}
}
代码示例来源:origin: yeyincai/grpc-demo
public static void main(String[] args) throws InterruptedException {
YycClientStart simpleClientStart = new YycClientStart();
simpleClientStart.createChannel();
/*************************/
YycServiceGrpc.YycServiceBlockingStub yycServiceBlockingStub = YycServiceGrpc.newBlockingStub(simpleClientStart.managedChannel);
SayHelloResponse sayHelloResponse1 = yycServiceBlockingStub.sayHello(StringValue.newBuilder().setValue("yyc hello").build());
System.out.println("response1:" + sayHelloResponse1.getResult());
SayHelloResponse sayHelloResponse2 = yycServiceBlockingStub.sayHello(StringValue.newBuilder().setValue("yyc hello").build());
System.out.println("response2:" + sayHelloResponse2.getResult());
SayHelloResponse sayHelloResponse3 = yycServiceBlockingStub.sayHello(StringValue.newBuilder().setValue("yyc hello").build());
System.out.println("response3:" + sayHelloResponse3.getResult());
simpleClientStart.managedChannel.shutdown();
}
}
内容来源于网络,如有侵权,请联系作者删除!