Exemplo n.º 1
0
        protected virtual async Task <ClaimsIdentity> GetIdentityByUserId(string userId)
        {
            var cacheKey = CacheKey.Create(CacheGroup, "GetIdentityByUserId", userId);
            var result   = await Options.CacheManager.Get(cacheKey, () => CreateIdentityByUserId(userId));

            return(result);
        }
Exemplo n.º 2
0
        private Category GetCategoryById(string categoryId)
        {
            var cacheKey = CacheKey.Create("CatalogOutlineBuilder.GetCategoryById", categoryId);
            var retVal   = _cacheManager.Get(cacheKey, () => _categoryService.GetById(categoryId));

            return(retVal);
        }
Exemplo n.º 3
0
        public T ExecuteScalar <T>(QueryDescription query, ObjectBinder objectBinder)
        {
            var      key        = CacheKey.Create(new HiveQueryCacheKey(query));
            Func <T> execution  = () => PerformExecuteScalar <T>(query, objectBinder);
            var      cacheCheck = ContextCacheAvailable() ? HiveContext.GenerationScopedCache.GetOrCreate(key, execution) : null;
            //var performExecute = PerformExecuteScalar<T>(query, objectBinder);
            var performExecute = cacheCheck != null ? cacheCheck.Value.Item : execution.Invoke();

            if ((!typeof(T).IsValueType && performExecute == null) || performExecute.Equals(default(T)))
            {
                return(default(T));
            }

            if (typeof(IReferenceByHiveId).IsAssignableFrom(typeof(T)))
            {
                ProviderRepositoryHelper.SetProviderAliasOnId(ProviderMetadata, (IReferenceByHiveId)performExecute);
            }

            if (typeof(IRelatableEntity).IsAssignableFrom(typeof(T)))
            {
                this.SetRelationProxyLazyLoadDelegate((IRelatableEntity)performExecute);
            }

            return(performExecute);
        }
Exemplo n.º 4
0
        public IEnumerable <T> ExecuteMany <T>(QueryDescription query, ObjectBinder objectBinder)
        {
            var key = CacheKey.Create(new HiveQueryCacheKey(query));
            Func <List <T> > execution = () =>
            {
                var executeItems = PerformExecuteMany <T>(query, objectBinder) ?? Enumerable.Empty <T>();
                return(executeItems.ToList());    // Ensure the executed sequence is cached
            };
            var cacheCheck = ContextCacheAvailable() ? HiveContext.GenerationScopedCache.GetOrCreate(key, execution) : null;

            var performExecute = cacheCheck != null ? cacheCheck.Value.Item : execution.Invoke();
            //var performExecute = PerformExecuteMany<T>(query, objectBinder) ?? Enumerable.Empty<T>();

            var items = performExecute
                        .ForAllThatAre <T, IReferenceByHiveId>(entity => ProviderRepositoryHelper.SetProviderAliasOnId(ProviderMetadata, entity))
                        .ForAllThatAre <T, IRelatableEntity>(entity => this.SetRelationProxyLazyLoadDelegate(entity));

            if (query.From.RequiredEntityIds.Any() && !query.SortClauses.Any())
            {
                // Return in same order as supplied ids
                return(query.From.RequiredEntityIds.Select(x => items.OfType <IReferenceByHiveId>().FirstOrDefault(y => y.Id.Value == x.Value)).WhereNotNull().OfType <T>());
            }

            return(items);
        }
Exemplo n.º 5
0
        private bool CanGenerateAFAMultiEventListPipe()
        {
            var typeOfTKey      = typeof(TKey);
            var typeOfTPayload  = typeof(TPayload);
            var typeOfTRegister = typeof(TRegister);

            if (!typeOfTPayload.CanRepresentAsColumnar())
            {
                return(false);
            }
            if (!typeOfTRegister.CanRepresentAsColumnar())
            {
                return(false);
            }
            if (typeOfTKey.GetPartitionType() != null)
            {
                return(false);
            }

            var lookupKey = CacheKey.Create((object)this.afa);

            var generatedPipeType = cachedPipes.GetOrAdd(lookupKey, key => AfaMultiEventListTemplate.GenerateAFA(this));

            this.errorMessages = generatedPipeType.Item2;
            return(generatedPipeType.Item1 != null);
        }
Exemplo n.º 6
0
        public TagIndex(CacheStream cache, IReadOnlyList <string> paths)
            : base(cache)
        {
            var binaryReader = new BinaryReader(cache);

            _classes = new List <TagClassHeirarchy>(new TagClassHeirarchy[classArrayCount]);
            for (var i = 0; i < classArrayCount; i++)
            {
                _classes[i] = new TagClassHeirarchy(binaryReader.ReadTagClass(), binaryReader.ReadTagClass(),
                                                    binaryReader.ReadTagClass());
            }

            _data = new List <TagDatum>(new TagDatum[datumArrayCount]);
            var cacheKey = CacheKey.Create(cache);

            for (var i = 0; i < datumArrayCount && i < paths.Count; i++)
            {
                TagDatum data;
                do
                {
                    data = new TagDatum
                    {
                        Class          = binaryReader.ReadTagClass( ),
                        Identifier     = binaryReader.ReadTagIdent( ),
                        VirtualAddress = binaryReader.ReadInt32( ),
                        Length         = binaryReader.ReadInt32( ),
                        CacheKey       = cacheKey
                    };
                } while (TagDatum.IsNull(data));
                data.Path = paths[i];
                _data[i]  = data;
            }
        }
Exemplo n.º 7
0
        public coreModel.Store GetById(string id)
        {
            var cacheKey = CacheKey.Create("StoreModule", "GetById", id);

            return(_cacheManager.Get(cacheKey, () =>
            {
                coreModel.Store retVal = null;
                using (var repository = _repositoryFactory())
                {
                    var entity = repository.GetStoreById(id);

                    if (entity != null)
                    {
                        //Load original typed shipping method and populate it  personalized information from db
                        retVal = entity.ToCoreModel(_shippingService.GetAllShippingMethods(), _paymentService.GetAllPaymentMethods());

                        var fulfillmentCenters = _commerceService.GetAllFulfillmentCenters().ToList();
                        retVal.ReturnsFulfillmentCenter = fulfillmentCenters.FirstOrDefault(x => x.Id == entity.ReturnsFulfillmentCenterId);
                        retVal.FulfillmentCenter = fulfillmentCenters.FirstOrDefault(x => x.Id == entity.FulfillmentCenterId);
                        retVal.SeoInfos = _commerceService.GetObjectsSeo(new[] { id }).ToList();

                        LoadObjectSettings(_settingManager, retVal);
                    }
                }
                return retVal;
            }));
        }
        public void CanRemoveItemFromCacheWithDelegate()
        {
            var myObject1 = new TestCacheObject("test-1");
            var myObject2 = new TestCacheObject("bob");
            var myObject3 = new TestCacheObject("frank");

            CacheProvider.AddOrChangeValue(CacheKey.Create <string>("my-1"), myObject1);
            CacheProvider.AddOrChangeValue(CacheKey.Create <StrongClassKey>(x => x.MyName = "bob"), myObject2);
            CacheProvider.AddOrChangeValue(CacheKey.Create <StrongClassKey>(x => x.MyName = "frank"), myObject3);

            var resultFilterClause       = new ResultFilterClause(typeof(string), ResultFilterType.Any, 0);
            var fromClause               = new FromClause(HiveId.Empty.ToString(), HierarchyScope.AncestorsOrSelf, FixedStatusTypes.Published);
            var fieldPredicateExpression = new FieldPredicateExpression("title", ValuePredicateType.Equal, "blah");


            //var key = new HiveQueryCacheKey(new QueryDescription(resultFilterClause, fromClause, fieldPredicateExpression, Enumerable.Empty<SortClause>()));
            var key = CacheKey.Create(new HiveQueryCacheKey(new QueryDescription(resultFilterClause, fromClause, fieldPredicateExpression, Enumerable.Empty <SortClause>())));

            CacheProvider.AddOrChangeValue(key, myObject3);

            Assert.NotNull(CacheProvider.GetValue(CacheKey.Create <string>("my-1")));
            Assert.NotNull(CacheProvider.GetValue(CacheKey.Create <StrongClassKey>(x => x.MyName = "bob")));
            Assert.NotNull(CacheProvider.GetValue(CacheKey.Create <string>("my-1")));
            Assert.NotNull(CacheProvider.GetValue(key));

            CacheProvider.RemoveWhereKeyMatches <string>(x => x == "my-1");
            CacheProvider.RemoveWhereKeyMatches <StrongClassKey>(x => x.MyName == "bob");
            CacheProvider.RemoveWhereKeyMatches <HiveQueryCacheKey>(x => x.From.HierarchyScope == HierarchyScope.AncestorsOrSelf);

            Assert.Null(CacheProvider.Get(CacheKey.Create <string>("my-1")));
            Assert.Null(CacheProvider.GetValue(CacheKey.Create <string>("my-1")));
            Assert.Null(CacheProvider.Get(CacheKey.Create <StrongClassKey>(x => x.MyName    = "bob")));
            Assert.NotNull(CacheProvider.Get(CacheKey.Create <StrongClassKey>(x => x.MyName = "frank")));
        }
        private storeModel.Store GetStoreById(string storeId)
        {
            var cacheKey = CacheKey.Create("MP", "GetStoreById", storeId);
            var retVal   = _cacheManager.Get(cacheKey, () => _storeService.GetById(storeId));

            return(retVal);
        }
        public IHttpActionResult GetStores()
        {
            var cacheKey = CacheKey.Create("MP", "GetStores");
            var stores   = _cacheManager.Get(cacheKey, this.GetFullLoadedStoreList);

            return(Ok(stores));
        }
Exemplo n.º 11
0
        protected override bool CanGenerateColumnar()
        {
            var typeOfTKey    = typeof(TKey);
            var typeOfTInput  = typeof(TInput);
            var typeOfTOutput = typeof(TOutput);

            if (!typeOfTInput.CanRepresentAsColumnar())
            {
                return(false);
            }
            if (typeOfTKey.GetPartitionType() != null)
            {
                return(false);
            }
            if (!typeOfTOutput.CanRepresentAsColumnar())
            {
                return(false);
            }

            var lookupKey = CacheKey.Create(this.apt, GetAggregateFunctionsHashCode(this.Aggregate));

            var tuple             = cachedPipes.GetOrAdd(lookupKey, key => AggregateTemplate.Generate(this, this.apt));
            var generatedPipeType = tuple.Item1;

            this.errorMessages = tuple.Item2;

            return(generatedPipeType != null);
        }
Exemplo n.º 12
0
        private bool CanGenerateColumnar()
        {
            var typeOfTOuterKey = typeof(TOuterKey);
            var typeOfTInnerKey = typeof(TInnerKey);
            var typeOfTResult   = typeof(TResult);

            if (!typeOfTResult.CanRepresentAsColumnar())
            {
                return(false);
            }
            if (typeOfTOuterKey.GetPartitionType() != null)
            {
                return(false);
            }
            if (typeOfTInnerKey.GetPartitionType() != null)
            {
                return(false);
            }
            // For now, restrict the inner key to be anything other than an anonymous type since those can't be ungrouped without using reflection.
            if (typeOfTInnerKey.IsAnonymousType())
            {
                return(false);
            }

            var lookupKey = CacheKey.Create(ResultSelector.ExpressionToCSharp());

            var generatedPipeType = cachedPipes.GetOrAdd(lookupKey, key => UngroupTemplate.Generate <TOuterKey, TInnerKey, TInnerResult, TResult>(ResultSelector));

            errorMessages = generatedPipeType.Item2;
            return(generatedPipeType.Item1 != null);
        }
Exemplo n.º 13
0
        protected override bool CanGenerateColumnar()
        {
            var typeOfTKey   = typeof(TKey);
            var typeOfTLeft  = typeof(TLeft);
            var typeOfTRight = typeof(TRight);

            if (!typeOfTLeft.CanRepresentAsColumnar())
            {
                return(false);
            }
            if (!typeOfTRight.CanRepresentAsColumnar())
            {
                return(false);
            }
            if (typeOfTKey.GetPartitionType() != null)
            {
                return(false);
            }

            var lookupKey = CacheKey.Create(this.Properties.KeyEqualityComparer.GetEqualsExpr().ToString(), this.LeftComparer.GetEqualsExpr().ToString());

            var generatedPipeType = cachedPipes.GetOrAdd(lookupKey, key => ClipJoinTemplate.Generate(this));

            this.errorMessages = generatedPipeType.Item2;
            return(generatedPipeType.Item1 != null);
        }
        public void SlidingExpiredItemIsRemoved()
        {
            var stringKey = CacheKey.Create <string>("hello");
            var myObject1 = CacheProvider.GetOrCreate(stringKey,
                                                      () => new CacheValueOf <TestCacheObject>(new TestCacheObject("hello-1"), new StaticCachePolicy(TimeSpan.FromSeconds(1))));

            Assert.NotNull(myObject1);

            Assert.That(myObject1.AlreadyExisted, Is.False);

            Assert.That(myObject1.WasInserted, Is.True);

            Assert.NotNull(myObject1.Value);

            if (CacheIsAsync)
            {
                Thread.Sleep(500);
            }

            Assert.NotNull(CacheProvider.GetValue <TestCacheObject>(stringKey));

            Assert.NotNull(CacheProvider.Get <TestCacheObject>(stringKey));

            Thread.Sleep(TimeSpan.FromSeconds(1.2d));

            Assert.Null(CacheProvider.Get <TestCacheObject>(stringKey));
        }
Exemplo n.º 15
0
        private bool CanGenerateColumnar()
        {
            var typeOfTOuterKey = typeof(TOuterKey);
            var typeOfTSource   = typeof(TSource);
            var typeOfTInnerKey = typeof(TInnerKey);

            if (!typeOfTSource.CanRepresentAsColumnar())
            {
                return(false);
            }
            if (typeOfTOuterKey.GetPartitionType() != null)
            {
                return(false);
            }
            if (typeOfTInnerKey.GetPartitionType() != null)
            {
                return(false);
            }

            var lookupKey = CacheKey.Create(KeySelector.ToString());

            var comparer          = (Properties.KeyEqualityComparer as CompoundGroupKeyEqualityComparer <TOuterKey, TInnerKey>).innerComparer.GetGetHashCodeExpr();
            var generatedPipeType = cachedPipes.GetOrAdd(lookupKey, key => GroupTemplate.Generate <TOuterKey, TSource, TInnerKey>(comparer, KeySelector, true));

            errorMessages = generatedPipeType.Item2;
            return(generatedPipeType.Item1 != null);
        }
Exemplo n.º 16
0
        protected override bool CanGenerateColumnar()
        {
            var typeOfTKey    = typeof(TKey);
            var typeOfTSource = typeof(TPayload);
            var typeOfTResult = typeof(TResult);

            if (!typeOfTSource.CanRepresentAsColumnar())
            {
                return(false);
            }
            if (!typeOfTResult.CanRepresentAsColumnar())
            {
                return(false);
            }
            if (typeOfTKey.GetPartitionType() != null)
            {
                return(false);
            }

            var lookupKey = CacheKey.Create(this.Selector.ExpressionToCSharp(), this.HasStartEdge, this.HasKey);

            var generatedPipeType = cachedPipes.GetOrAdd(lookupKey, key => SelectTemplate.Generate(this));

            this.errorMessages = generatedPipeType.Item2;
            return(generatedPipeType.Item1 != null);
        }
Exemplo n.º 17
0
        private bool CanGenerateColumnar()
        {
            var typeOfTOuterKey = typeof(TOuterKey);
            var typeOfTSource   = typeof(TSource);
            var typeOfTInnerKey = typeof(TInnerKey);

            if (!typeOfTSource.CanRepresentAsColumnar())
            {
                return(false);
            }
            if (typeOfTOuterKey.GetPartitionType() != null)
            {
                return(false);
            }
            if (typeOfTInnerKey.GetPartitionType() != null)
            {
                return(false);
            }

            // For now, restrict the inner key to be anything other than an anonymous type since those can't be ungrouped without using reflection.
            if (typeOfTInnerKey.IsAnonymousType())
            {
                return(false);
            }

            var lookupKey = CacheKey.Create(KeySelector.ToString());

            var comparer          = Properties.KeyEqualityComparer.GetGetHashCodeExpr();
            var generatedPipeType = cachedPipes.GetOrAdd(lookupKey, key => GroupTemplate.Generate <TOuterKey, TSource, TInnerKey>(comparer, KeySelector, false));

            errorMessages = generatedPipeType.Item2;
            return(generatedPipeType.Item1 != null);
        }
Exemplo n.º 18
0
        public static MemoryPool <TKey, TPayload> GetMemoryPool <TKey, TPayload>(bool isColumnar = true)
        {
            if (Config.ForceRowBasedExecution)
            {
                isColumnar = false;
            }

            var typeOfTKey     = typeof(TKey);
            var typeOfTPayload = typeof(TPayload);

            var cacheKey = CacheKey.Create(typeof(TKey), typeof(TPayload), isColumnar);

            if (!isColumnar ||
                (!typeOfTKey.KeyTypeNeedsGeneratedMemoryPool() &&
                 typeOfTPayload.MemoryPoolHasGetMethodFor()))
            {
                return((MemoryPool <TKey, TPayload>)memoryPools.GetOrAdd(cacheKey, key => new MemoryPool <TKey, TPayload>(isColumnar)));
            }
            if (!typeOfTPayload.CanRepresentAsColumnar())
            {
                return((MemoryPool <TKey, TPayload>)memoryPools.GetOrAdd(cacheKey, new MemoryPool <TKey, TPayload>(false)));
            }
            var lookupKey = CacheKey.Create(typeOfTKey, typeOfTPayload);

            Type generatedMemoryPool = cachedMemoryPools.GetOrAdd(lookupKey, key => Transformer.GenerateMemoryPoolClass <TKey, TPayload>());

            return((MemoryPool <TKey, TPayload>)memoryPools.GetOrAdd(cacheKey, t => Activator.CreateInstance(generatedMemoryPool)));
        }
Exemplo n.º 19
0
        public coreModel.Store Create(coreModel.Store store)
        {
            var dbStore = store.ToDataModel();

            using (var repository = _repositoryFactory())
            {
                repository.Add(dbStore);
                CommitChanges(repository);
            }

            //Need add seo separately
            if (store.SeoInfos != null)
            {
                foreach (var seoInfo in store.SeoInfos)
                {
                    seoInfo.ObjectId   = dbStore.Id;
                    seoInfo.ObjectType = typeof(coreModel.Store).Name;
                    _commerceService.UpsertSeo(seoInfo);
                }
            }

            //Deep save settings
            SaveObjectSettings(_settingManager, store);


            //Reset cache
            var cacheKey = CacheKey.Create("StoreModule", "GetById", store.Id);

            _cacheManager.Remove(cacheKey);

            var retVal = GetById(store.Id);

            return(retVal);
        }
        public void CanAddAtLeast300ItemsPerSecond()
        {
            var watch = new Stopwatch();

            TypedEntity[] itemsToAdd = new TypedEntity[500];
            for (int i = 0; i < 300; i++)
            {
                var item = HiveModelCreationHelper.MockTypedEntity(true);
                itemsToAdd[i] = item;
            }

            watch.Start();
            for (int i = 0; i < 300; i++)
            {
                CacheProvider.AddOrChangeValue(CacheKey.Create("Item " + i), itemsToAdd[i]);
            }
            watch.Stop();
            var writeElapsed = watch.Elapsed;

            watch.Reset();
            watch.Start();
            for (int i = 0; i < 300; i++)
            {
                var cacheKey = CacheKey.Create("Item " + i);
                var item     = CacheProvider.Get <TypedEntity>(cacheKey);
                Assert.That(item, Is.Not.Null);
            }
            watch.Stop();
            var readElapsed = watch.Elapsed;

            LogHelper.TraceIfEnabled <AbstractCacheProviderFixture>("Write Took (s): " + writeElapsed.TotalSeconds);
            LogHelper.TraceIfEnabled <AbstractCacheProviderFixture>("Read Took (s): " + readElapsed.TotalSeconds);
            Assert.That(writeElapsed, Is.LessThan(TimeSpan.FromSeconds(1)));
            Assert.That(readElapsed, Is.LessThan(TimeSpan.FromSeconds(1)));
        }
Exemplo n.º 21
0
        public void CacheKeySerializesToJson()
        {
            var key       = CacheKey.Create <string>("my-1");
            var keyString = key.ToString();
            var keyJson   = key.ToJson();

            Assert.That(keyString, Is.EqualTo(keyJson));
        }
Exemplo n.º 22
0
        private Tuple <Type, string> GetPipe()
        {
            var lookupKey = CacheKey.Create(this.apt, GetAggregateFunctionsHashCode(this.Aggregate));

            var tuple = cachedPipes.GetOrAdd(lookupKey, key => AggregateTemplate.Generate(this, this.apt));

            return(tuple);
        }
Exemplo n.º 23
0
        protected override bool CanGenerateColumnar()
        {
            var lookupKey = CacheKey.Create();

            var generatedPipeType = cachedPipes.GetOrAdd(lookupKey, key => SessionWindowTemplate.Generate(this));

            this.errorMessages = generatedPipeType.Item2;
            return(generatedPipeType.Item1 != null);
        }
Exemplo n.º 24
0
        public static ColumnPool <T> GetColumnPool <T>(int size = -1)
        {
            if (size == -1)
            {
                size = Config.DataBatchSize;
            }

            return((ColumnPool <T>)columnPools.GetOrAdd(CacheKey.Create(typeof(T), size), new ColumnPool <T>(size)));
        }
Exemplo n.º 25
0
        private UnaryPipe <TKey, TPayload, TRegister> GetAFAMultiEventListPipe(IStreamObserver <TKey, TRegister> observer)
        {
            var lookupKey         = CacheKey.Create((object)this.afa);
            var generatedPipeType = cachedPipes.GetOrAdd(lookupKey, key => AfaMultiEventListTemplate.GenerateAFA(this));

            var instance    = Activator.CreateInstance(generatedPipeType.Item1, this, observer, this.afa, this.MaxDuration);
            var returnValue = (UnaryPipe <TKey, TPayload, TRegister>)instance;

            return(returnValue);
        }
Exemplo n.º 26
0
        public void CacheKeyEquals()
        {
            var one   = CacheKey.Create <string>("this");
            var two   = CacheKey.Create <string>("this");
            var three = (CacheKey)(CacheKey <string>)two.ToJson();

            Assert.That(one, Is.EqualTo(two));
            Assert.That(two, Is.EqualTo(three));
            Assert.That(two.GetHashCode(), Is.EqualTo(three.GetHashCode()));
        }
Exemplo n.º 27
0
        private EgressBoundary <PartitionKey <TKey>, TPayload, TResult> GetPipe(IObserver <TResult> observer)
        {
            var lookupKey = CacheKey.Create(this.constructor.Body.ExpressionToCSharp(), this.source.Properties.IsColumnar);

            var generatedPipeType = cachedPipes.GetOrAdd(lookupKey, key => TemporalEgressTemplate.Generate(this));

            var instance    = Activator.CreateInstance(generatedPipeType.Item1, observer, this.container);
            var returnValue = (EgressBoundary <PartitionKey <TKey>, TPayload, TResult>)instance;

            return(returnValue);
        }
Exemplo n.º 28
0
        private UnaryPipe <Empty, TPayload, TRegister> GetUngroupedAFAPipe(IStreamObserver <Empty, TRegister> observer)
        {
            var lookupKey         = CacheKey.Create((object)this.afa);
            var downcast          = this as AfaStreamable <Empty, TPayload, TRegister, TAccumulator>;
            var generatedPipeType = cachedPipes.GetOrAdd(lookupKey, key => UngroupedAfaTemplate.GenerateAFA(downcast));

            var instance    = Activator.CreateInstance(generatedPipeType.Item1, this, observer, this.afa, this.MaxDuration);
            var returnValue = (UnaryPipe <Empty, TPayload, TRegister>)instance;

            return(returnValue);
        }
Exemplo n.º 29
0
        public void HiveRelationCacheKeyToFromJson()
        {
            var guid         = Guid.NewGuid();
            var key          = CacheKey.Create(new HiveRelationCacheKey(HiveRelationCacheKey.RepositoryTypes.Entity, new HiveId(guid), Direction.Siblings, FixedRelationTypes.ApplicationRelationType));
            var keyJson      = key.ToJson();
            var keyBack      = (CacheKey <HiveRelationCacheKey>)keyJson;
            var keyJsonTwice = keyBack.ToJson();

            Assert.That(keyBack, Is.Not.Null);
            Assert.That(keyJson, Is.EqualTo(keyJsonTwice));
        }
Exemplo n.º 30
0
        private EgressBoundary <Empty, TPayload, StreamEvent <TPayload> > GetPipe(IObserver <StreamEvent <TPayload> > observer)
        {
            var lookupKey = CacheKey.Create(this.source.Properties.IsColumnar);

            var generatedPipeType = cachedPipes.GetOrAdd(lookupKey, key => TemporalEgressTemplate.Generate(this));

            var instance    = Activator.CreateInstance(generatedPipeType.Item1, observer, this.container);
            var returnValue = (EgressBoundary <Empty, TPayload, StreamEvent <TPayload> >)instance;

            return(returnValue);
        }