protected GrpcProxyBase(GrpcProxyArgs proxyArgs, GrpcProxyMethod[] proxyMethods) : base(proxyArgs, proxyMethods)
        {
            if (proxyArgs is null)
            {
                throw new ArgumentNullException(nameof(proxyArgs));
            }

            this.grpcInvoker      = proxyArgs.CallInvoker;
            this.Serializer       = proxyArgs.Serializer;
            this.grpcMethodsCache = proxyArgs.MethodsCache;
        }
Esempio n. 2
0
 internal GrpcProxyArgs(IRpcChannel connection,
                        GrpcCore.CallInvoker callInvoker,
                        RpcObjectId objectId,
                        GrpcMethodsCache methodsCache,
                        IRpcSerializer serializer,
                        IReadOnlyCollection <string>?implementedServices,
                        SynchronizationContext?syncContext)
     : base(connection, objectId, serializer, implementedServices, syncContext)
 {
     this.CallInvoker  = callInvoker;
     this.MethodsCache = methodsCache;
 }
Esempio n. 3
0
        private GrpcMethodsCache GetMethodCache(IRpcSerializer serializer)
        {
            lock (this.syncRoot)
            {
                if (this.serializerToMethodsCache.TryGetValue(serializer, out var existingMethodsCache))
                {
                    return(existingMethodsCache);
                }

                var methodsCache = new GrpcMethodsCache(serializer);
                this.serializerToMethodsCache.Add(serializer, methodsCache);

                return(methodsCache);
            }
        }