コード例 #1
0
        private bool CanGenerateGroupedAFAMultiEventPipe()
        {
            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 => GroupedAfaMultiEventTemplate.GenerateAFA(this));

            this.errorMessages = generatedPipeType.Item2;
            return(generatedPipeType.Item1 != null);
        }
コード例 #2
0
ファイル: AfaStreamable.cs プロジェクト: kgisme170/mynet
        private UnaryPipe <TKey, TPayload, TRegister> GetGroupedAFAMultiEventPipe(IStreamObserver <TKey, TRegister> observer)
        {
            var lookupKey         = CacheKey.Create((object)this.afa);
            var generatedPipeType = cachedPipes.GetOrAdd(lookupKey, key => GroupedAfaMultiEventTemplate.GenerateAFA(this));

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

            return(returnValue);
        }