ProductionPoint(ISequencerTaskRegister taskRegister, ISequencerExceptionRegister exceptionRegister, SeqPointTypeUC seqPointTypeUC, object arg = null, Action <object> injectContinuation = null) => SequencerStrategy.ProductionPoint(taskRegister, exceptionRegister, seqPointTypeUC, arg, injectContinuation) ;
PointAsyncArg <TEnum, TArg>(this ISequencerUC sequencer, SeqPointTypeUC seqPointTypeUC, TEnum registration, Func <bool> condition, TArg arg, Action <object> injectContinuation = null) where TEnum : struct { SequencerRegisterUC register = sequencer as SequencerRegisterUC; if (register == null || condition == null || !condition()) { return(CompletedAwaiter); } ISequencerExceptionRegister exceptionRegister = register.ExceptionRegister.TryReThrowException(); ISequencerTaskRegister taskRegister = register.TaskRegister; ISequencerPointUC <TEnum> seqPoint = register.TryGet(registration); return (seqPoint?.ProductionPoint(taskRegister, exceptionRegister, seqPointTypeUC, arg, injectContinuation) ?? CompletedAwaiter ); }
public ProductionPointUC(ISequencerTaskRegister taskRegister, ISequencerExceptionRegister exceptionRegister, SeqPointTypeUC seqPointType, object productionArg = null, Action <object> injectContinuation = null) { SeqPointType = seqPointType; ProductionArg = productionArg; TaskRegister = taskRegister; ExceptionRegister = exceptionRegister; if (SeqPointType == SeqPointTypeUC.Match) { InjectContinuation = injectContinuation; ExecutionContext = InjectContinuation != null?ExecutionContext.Capture() : null; SynchronizationContext = InjectContinuation != null ? SynchronizationContext.Current : null; TaskScheduler = InjectContinuation != null && SynchronizationContext == null ? TaskScheduler.Current : null; return; } if (SeqPointType == SeqPointTypeUC.Notify) { Complete(); } exceptionRegister.Token.Register(OnCancel); }
TestPointAsync <TEnum>(this ISequencerUC sequencer, TEnum registration) where TEnum : struct { if (!(sequencer is SequencerRegisterUC register)) { return(TestPointUC.EmptyCompleted); } ISequencerExceptionRegister exceptionRegister = register.ExceptionRegister.TryReThrowException(); ISequencerTaskRegister taskRegister = register.TaskRegister; ISequencerPointUC <TEnum> seqPoint = register.TryGet(registration); return (seqPoint?.TestPoint(taskRegister, exceptionRegister) ?? TestPointUC.EmptyCompleted ); }
TestPoint(ISequencerTaskRegister taskRegister, ISequencerExceptionRegister exceptionRegister) { TestPointUC testPoint = new TestPointUC(taskRegister, exceptionRegister); IProductionPointUC productionMatch = null; ITestPointUC testMatch = null; using (Lock.Enter()) { TestPointQueue.Enqueue(testPoint); if (ProductionPointQueue.Count > 0 && TestPointQueue.Count > 0) { productionMatch = ProductionPointQueue.Dequeue(); testMatch = TestPointQueue.Dequeue(); } } testMatch?.Complete(productionMatch); return(testPoint); }
ProductionPoint(ISequencerTaskRegister taskRegister, ISequencerExceptionRegister exceptionRegister, SeqPointTypeUC seqPointTypeUC, object arg = null, Action <object> injectContinuation = null) { ProductionPointUC productionPoint = new ProductionPointUC(taskRegister, exceptionRegister, seqPointTypeUC, arg, injectContinuation); IProductionPointUC productionMatch = null; ITestPointUC testMatch = null; using (Lock.Enter()) { ProductionPointQueue.Enqueue(productionPoint); if (ProductionPointQueue.Count > 0 && TestPointQueue.Count > 0) { productionMatch = ProductionPointQueue.Dequeue(); testMatch = TestPointQueue.Dequeue(); } } testMatch?.Complete(productionMatch); return(productionPoint); }
TestPoint(ISequencerTaskRegister taskRegister, ISequencerExceptionRegister exceptionRegister) => SequencerStrategy.TestPoint(taskRegister, exceptionRegister) ;
public SequencerTaskRegister(ISequencerUC sequencerUC, ISequencerExceptionRegister exceptionRegister) { SequencerUC = sequencerUC; ExceptionRegister = exceptionRegister; }
public TestPointUC(ISequencerTaskRegister taskRegister, ISequencerExceptionRegister exceptionRegister) { TaskRegister = taskRegister; ExceptionRegister = exceptionRegister; exceptionRegister.Token.Register(OnCancel); }