Exemple #1
0
 private Braid(string name, BraidLinkDiscriminators discriminators, ChainBuilder chainBuilder, int addThreshold)
 {
     Name            = name;
     _discriminators = discriminators;
     _chainBuilder   = chainBuilder;
     _addThreshold   = addThreshold;
 }
 private BraidBuilder(string name, BraidLinkDiscriminators discriminators, ChainBuilder chainBuilder, LongitudinalEvaluators evaluators, int addThreshold)
 {
     Name = name;
     this._discriminators = discriminators;
     this._chainBuilder   = chainBuilder;
     _evaluators          = evaluators;
     this._addThreshold   = addThreshold;
 }
Exemple #3
0
        internal static Braid Build(string name, BraidLinkDiscriminators discriminators, ChainBuilder chainBuilder, int addThreshold = 1)
        {
            var braid = new Braid(name, discriminators, chainBuilder, addThreshold);

            chainBuilder.AddBraid(braid);

            chainBuilder.AcceptAddChainAction(braid._chains.ContainsKey, braid._chains.Add, x => braid._chains[x]);

            // wire up async here
            var subscription = braid._chainBuilderSubject.Subscribe(x =>
            {
                var discriminationResult = braid._discriminators.Discriminate(x);

                if (discriminationResult >= braid._addThreshold)
                {
                    braid._chainBuilder.Accept(x);
                }
            });

            braid._subscription = subscription;

            return(braid);
        }
        public static BraidBuilder Build(string name, BraidLinkDiscriminators discriminators, ChainBuilder chainBuilder, LongitudinalEvaluators evaluators, int addThreshold = 1)
        {
            var braidBuilder = new BraidBuilder(name, discriminators, chainBuilder, evaluators, addThreshold);

            return(braidBuilder);
        }