Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Task <TResponse> ClientCallAsync(TRequest request)
        {
            lock (SyncRoot)
            {
                var tcs = new TaskCompletionSource <TResponse>();

                EnsureCallHandler();

                using (var context = SendCallContext.Create(tcs))
                {
                    var payload = Serialize.Invoke(request);
                    callHandler.ClientCall(payload, context, ReceivedMessageCallback);
                }

                return(tcs.Task);
            }
        }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public Task <TResponse> ClientStreamingCallAsync()
        {
            lock (SyncRoot)
            {
                //GrpcPreconditions.CheckState(!started);
                //started = true;

                //Initialize(details.Channel.CompletionQueue);

                //readingDone = true;

                var tcs = new TaskCompletionSource <TResponse>();

                using (var context = SendCallContext.Create(tcs))
                {
                    //call.StartClientStreaming(UnaryResponseClientCallback, metadataArray, details.Options.Flags);
                }

                return(tcs.Task);
            }
        }