public TextWriterPublisher(TextWriter writer, bool ownsWriter = default, IUnhandledExceptionObserver unhandledExceptionObserver = default) { writer.EnsureNotNull(nameof(writer)); // _writer = writer; _ownsWriter = ownsWriter; _syncCtx = new StatefulSynchronizationContext <Nil>(stateFactory: locCt => VoidVh.Instance, stopToken: default, correlationId: default, autoStart: true, unhandledExceptionObserver: unhandledExceptionObserver);
internal P_SignalSubscription(ITrigger trigger, IUnhandledExceptionObserver unhandledExceptionObserver, Action <ITriggerSignalProperties, IDisposable> onSignal) : base(trigger: trigger, unhandledExceptionObserver: unhandledExceptionObserver) { // onSignal.EnsureNotNull(nameof(onSignal)); // _onSignal = onSignal; }
private protected P_SignalSubscriptionBase(ITrigger trigger, IUnhandledExceptionObserver unhandledExceptionObserver) { trigger.EnsureNotNull(nameof(trigger)); unhandledExceptionObserver.EnsureNotNull(nameof(unhandledExceptionObserver)); // _trigger = trigger; _unhandledExceptionObserver = unhandledExceptionObserver; // P_SubscribeToNextSignal(); }
public static IUnhandledExceptionObserver DeriveObserver( this IUnhandledExceptionObserver baseObserver, ArgumentPlaceholder <object> component = default, ArgumentPlaceholder <string> message = default, ArgumentPlaceholder <IContext> exceptionCtx = default) { // if (baseObserver is null) { return(null); } else { return(new P_DelegatedUnhandledExceptionObserver(observe: baseObserver.ObserveException, component: component, message: message, exceptionCtx: exceptionCtx)); } }
public static IDisposable SubscribeToSignal <TState1, TState2>( this ITrigger trigger, Action <ITriggerSignalProperties, IDisposable, TState1, TState2> onSignal, TState1 state1, TState2 state2, IUnhandledExceptionObserver exceptionObserver = default) { // onSignal.EnsureNotNull(nameof(onSignal)); // return (new P_SignalSubscription <Tuple <TState1, TState2> >( trigger: trigger, unhandledExceptionObserver: exceptionObserver ?? UnhandledExceptionObserverOption.Require(), onSignal: (locSignalProps, locSubscription, locState) => onSignal(locSignalProps, locSubscription, locState.Item1, locState.Item2), state: Tuple(state1, state2))); }
public XAppContainerControl(IUnhandledExceptionObserver unhandledExceptionObserver = default) { _configuration = new DisposableLazy <IXAppContainerControlConfiguration>( factory: () => { // TODO: Put strings into the resources. // RequireConfiguration(configuration: out var locConfiguration); if (locConfiguration is null) { throw new EonException(message: $"No configuration provided for this component (see method '{nameof(RequireConfiguration)}').{Environment.NewLine}\tComponent:{this.FmtStr().GNLI2()}"); } return(locConfiguration); }, ownsValue: false); P_CtorInitializer(unhandledExceptionObserver: unhandledExceptionObserver); }
void P_CtorInitializer(IUnhandledExceptionObserver unhandledExceptionObserver = default) { _unhandledExceptionObserver = unhandledExceptionObserver ?? UnhandledExceptionObserverOption.Require(); _runControl = new RunControl <XAppContainerControl>(options: RunControlOptions.SingleStart, component: this, start: DoStartAsync, stop: DoShutdownAsync); }
public XAppContainerControl(IXAppContainerControlConfiguration configuration, bool ownsConfiguration = false, IUnhandledExceptionObserver unhandledExceptionObserver = default) { configuration.EnsureNotNull(nameof(configuration)); // _configuration = new DisposableLazy <IXAppContainerControlConfiguration>(value: configuration, ownsValue: ownsConfiguration); P_CtorInitializer(unhandledExceptionObserver: unhandledExceptionObserver); }
public UnhandledExceptionObserverOption(IUnhandledExceptionObserver observer) { observer.EnsureNotNull(nameof(observer)); // Observer = observer; }
public static IDisposable SubscribeToSignal <TState>(this ITrigger trigger, Action <ITriggerSignalProperties, IDisposable, TState> onSignal, TState state, IUnhandledExceptionObserver exceptionObserver = default) => new P_SignalSubscription <TState>(trigger: trigger, unhandledExceptionObserver: exceptionObserver ?? UnhandledExceptionObserverOption.Require(), onSignal: onSignal, state: state);