コード例 #1
0
        public ServiceInstance()
        {
            var instanceId = NewId.Next();

            InstanceId   = instanceId.ToGuid();
            InstanceName = instanceId.ToString(Util.FormatUtil.Formatter);

            _clientCache = new ServiceInstanceClientCache();
        }
コード例 #2
0
        public ServiceEndpointClientCache(IServiceInstanceClientCache instanceClientCache)
        {
            _instanceClientCache = instanceClientCache;

            _cache = new GreenCache <ServiceClientContext>(ServiceInstanceClientCacheDefaults.Settings);
            _index = _cache.AddIndex("clientId", x => x.ClientId);

            _messageTypes = new ConcurrentDictionary <Type, IServiceEndpointMessageClientCache>();

            instanceClientCache.Connect(this);
        }