/** * Executes a server-streaming call returning a blocking {@link Iterator} over the * response stream. * * @return an iterator over the response stream. */ // TODO(louiscryan): Not clear if we want to use this idiom for 'simple' stubs. public static <ReqT, RespT> Iterator<RespT> blockingServerStreamingCall( Channel channel, MethodDescriptor<ReqT, RespT> method, CallOptions callOptions, ReqT param) { ThreadlessExecutor executor = new ThreadlessExecutor(); ClientCall<ReqT, RespT> call = channel.newCall(method, callOptions.withExecutor(executor)); BlockingResponseStream<RespT> result = new BlockingResponseStream<RespT>(call, executor); asyncUnaryRequestCall(call, param, result.listener(), true); return result; }
/** * Executes a server-streaming call returning a blocking {@link Iterator} over the * response stream. * @return an iterator over the response stream. */ // TODO(louiscryan): Not clear if we want to use this idiom for 'simple' stubs. public static <ReqT, RespT> Iterator<RespT> blockingServerStreamingCall( ClientCall<ReqT, RespT> call, ReqT param) { BlockingResponseStream<RespT> result = new BlockingResponseStream<RespT>(call); asyncUnaryRequestCall(call, param, result.listener(), true); return result; }