Пример #1
0
 private StreamsSettings(StreamsSettings existing) : base(existing)
 {
     gax::GaxPreconditions.CheckNotNull(existing, nameof(existing));
     StreamCallSettings          = existing.StreamCallSettings;
     StreamCallStreamingSettings = existing.StreamCallStreamingSettings;
     OnCopy(existing);
 }
Пример #2
0
        /// <summary>
        /// Constructs a client wrapper for the Streams service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="StreamsSettings"/> used within this client.</param>
        public StreamsClientImpl(Streams.StreamsClient grpcClient, StreamsSettings settings)
        {
            GrpcClient = grpcClient;
            StreamsSettings       effectiveSettings = settings ?? StreamsSettings.GetDefault();
            gaxgrpc::ClientHelper clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callStreamCall = clientHelper.BuildApiCall <StreamCallRequest, StreamCallResponse>(grpcClient.StreamCall, effectiveSettings.StreamCallSettings, effectiveSettings.StreamCallStreamingSettings);
            Modify_ApiCall(ref _callStreamCall);
            Modify_StreamCallApiCall(ref _callStreamCall);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
Пример #3
0
        /// <summary>
        /// Creates a <see cref="StreamsClient"/> which uses the specified call invoker for remote operations.
        /// </summary>
        /// <param name="callInvoker">
        /// The <see cref="grpccore::CallInvoker"/> for remote operations. Must not be null.
        /// </param>
        /// <param name="settings">Optional <see cref="StreamsSettings"/>.</param>
        /// <returns>The created <see cref="StreamsClient"/>.</returns>
        internal static StreamsClient Create(grpccore::CallInvoker callInvoker, StreamsSettings settings = null)
        {
            gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
            grpcinter::Interceptor interceptor = settings?.Interceptor;

            if (interceptor != null)
            {
                callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor);
            }
            Streams.StreamsClient grpcClient = new Streams.StreamsClient(callInvoker);
            return(new StreamsClientImpl(grpcClient, settings));
        }
Пример #4
0
 partial void OnCopy(StreamsSettings existing);
Пример #5
0
 partial void OnConstruction(Streams.StreamsClient grpcClient, StreamsSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);