private Chain(ChainIdentity chainIdentity, Braid braid, LongitudinalEvaluators longitudinalEvaluators, LongitudinalEvaluations evaluations) { _longitudinalEvaluators = longitudinalEvaluators; _evaluations = evaluations; ChainIdentity = chainIdentity; Braid = braid; }
public static Chain Build(ChainIdentity chainIdentity, Braid braid, LongitudinalEvaluators longitudinalEvaluators) { var evaluations = new LongitudinalEvaluations(); longitudinalEvaluators.SetEvaluationDestination(evaluations); return(new Chain(chainIdentity, braid, longitudinalEvaluators, evaluations)); }
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); }
internal void AddBraid(Braid braid) { _braid = braid; }
public Braid BuildBraid(Trunk trunk) { var braid = Braid.Build(Name, _discriminators, _chainBuilder, _addThreshold); return(braid); }