/** * Create a bidirectional streaming callable object with grpc-specific functionality. Designed for * use by generated code. * * @param innerCallable the callable that performs the work * @param streamingCallSettings {@link StreamingCallSettings} to configure the method-level * settings with. * @param clientContext {@link ClientContext} to use to connect to the service. * @return {@link BidiStreamingCallable} callable object. */ public static <RequestT, ResponseT> BidiStreamingCallable<RequestT, ResponseT> createBidiStreamingCallable( BidiStreamingCallable<RequestT, ResponseT> innerCallable, StreamingCallSettings<RequestT, ResponseT> streamingCallSettings, ClientContext clientContext) { return innerCallable.withDefaultCallContext(FakeCallContext.create(clientContext)); }
/** * Create a bidirectional streaming callable object with grpc-specific functionality. Designed for * use by generated code. * * @param grpcCallSettings the gRPC call settings * @param streamingCallSettings {@link StreamingCallSettings} to configure the method-level * settings with. * @param clientContext {@link ClientContext} to use to connect to the service. * @return {@link BidiStreamingCallable} callable object. */ @BetaApi("The surface for streaming is not stable yet and may change in the future.") public static <RequestT, ResponseT> BidiStreamingCallable<RequestT, ResponseT> createBidiStreamingCallable( GrpcCallSettings<RequestT, ResponseT> grpcCallSettings, StreamingCallSettings<RequestT, ResponseT> streamingCallSettings, ClientContext clientContext) { BidiStreamingCallable<RequestT, ResponseT> callable = new GrpcDirectBidiStreamingCallable<>(grpcCallSettings.getMethodDescriptor()); callable = new GrpcExceptionBidiStreamingCallable<>(callable, ImmutableSet.<StatusCode.Code>of()); return callable.withDefaultCallContext(clientContext.getDefaultCallContext()); }
/** * Create a bidirectional streaming callable object with grpc-specific functionality. Designed for * use by generated code. * * @param grpcCallSettings the gRPC call settings * @param streamingCallSettings {@link StreamingCallSettings} to configure the method-level * settings with. * @param clientContext {@link ClientContext} to use to connect to the service. * @return {@link BidiStreamingCallable} callable object. */ @BetaApi("The surface for streaming is not stable yet and may change in the future.") public static <RequestT, ResponseT> BidiStreamingCallable<RequestT, ResponseT> createBidiStreamingCallable( GrpcCallSettings<RequestT, ResponseT> grpcCallSettings, StreamingCallSettings<RequestT, ResponseT> streamingCallSettings, ClientContext clientContext) { BidiStreamingCallable<RequestT, ResponseT> callable = new GrpcDirectBidiStreamingCallable<>(grpcCallSettings.getMethodDescriptor()); callable = new GrpcExceptionBidiStreamingCallable<>(callable, ImmutableSet.<StatusCode.Code>of()); callable = new TracedBidiCallable<>( callable, clientContext.getTracerFactory(), getSpanName(grpcCallSettings.getMethodDescriptor())); return callable.withDefaultCallContext(clientContext.getDefaultCallContext()); }