Exemple #1
0
 internal static ApiBidirectionalStreamingCall <TRequest, TResponse> Create <TRequest, TResponse>(
     Func <CallOptions, AsyncDuplexStreamingCall <TRequest, TResponse> > grpcCall,
     CallSettings baseCallSettings,
     BidirectionalStreamingSettings streamingSettings,
     IClock clock)
 {
     return(new ApiBidirectionalStreamingCall <TRequest, TResponse>(
                cs => grpcCall(cs.ToCallOptions(clock)),
                baseCallSettings,
                streamingSettings));
 }
Exemple #2
0
        /// <summary>
        /// Builds an <see cref="ApiBidirectionalStreamingCall"/> given a suitable underlying duplex call.
        /// </summary>
        /// <typeparam name="TRequest">Request type, which must be a protobuf message.</typeparam>
        /// <typeparam name="TResponse">Response type, which must be a protobuf message.</typeparam>
        /// <param name="grpcCall">The underlying gRPC duplex streaming call.</param>
        /// <param name="perMethodCallSettings">The default method call settings.</param>
        /// <param name="streamingSettings">The default streaming settings.</param>
        /// <returns>An API call to proxy to the RPC calls</returns>
        public ApiBidirectionalStreamingCall <TRequest, TResponse> BuildApiCall <TRequest, TResponse>(
            Func <CallOptions, AsyncDuplexStreamingCall <TRequest, TResponse> > grpcCall,
            CallSettings perMethodCallSettings,
            BidirectionalStreamingSettings streamingSettings)
            where TRequest : class, IMessage <TRequest>
            where TResponse : class, IMessage <TResponse>
        {
            CallSettings baseCallSettings = _clientCallSettings.MergedWith(perMethodCallSettings);

            return(ApiBidirectionalStreamingCall.Create(grpcCall, baseCallSettings, streamingSettings, Clock)
                   .WithMergedBaseCallSettings(_versionCallSettings));
        }
Exemple #3
0
 internal static ApiBidirectionalStreamingCall <TRequest, TResponse> Create <TRequest, TResponse>(
     string methodName,
     Func <CallOptions, AsyncDuplexStreamingCall <TRequest, TResponse> > grpcCall,
     CallSettings baseCallSettings,
     BidirectionalStreamingSettings streamingSettings,
     IClock clock)
 {
     return(new ApiBidirectionalStreamingCall <TRequest, TResponse>(
                methodName,
                cs => grpcCall(cs.ValidateNoRetry().ToCallOptions(clock)),
                baseCallSettings,
                streamingSettings));
 }