/**
* Creates a new async stub that supports all call types for the service
*/
public static GoodsServiceStub newStub(io.grpc.Channel channel) {
return new GoodsServiceStub(channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static GoodsServiceBlockingStub newBlockingStub(
io.grpc.Channel channel) {
return new GoodsServiceBlockingStub(channel);
}
通過源碼註釋可以看到:
newStub: 是創建一個新的異步的stub,可以支持所有的服務調用;
newBlockingStub:創建一個新的阻塞式的sutb,可以支持一元和流式輸出的服務調用