<PackageReference Include="System.Reactive" Version="5.0.0" />

Throw<TResult>

sealed class Throw<TResult> : Producer<TResult, _<TResult>>
using System.Reactive.Concurrency; using System.Runtime.CompilerServices; namespace System.Reactive.Linq.ObservableImpl { [System.Runtime.CompilerServices.NullableContext(1)] [System.Runtime.CompilerServices.Nullable(new byte[] { 0, 1, 1, 1 })] internal sealed class Throw<[System.Runtime.CompilerServices.Nullable(2)] TResult> : Producer<TResult, Throw<TResult>._> { [System.Runtime.CompilerServices.Nullable(new byte[] { 0, 1 })] internal sealed class _ : IdentitySink<TResult> { private readonly Exception _exception; public _(Exception exception, IObserver<TResult> observer) : base(observer) { _exception = exception; } public void Run(IScheduler scheduler) { SetUpstream(Scheduler.ScheduleAction<_>(scheduler, this, (Action<_>)delegate(_ this) { this.ForwardOnError(this._exception); })); } } private readonly Exception _exception; private readonly IScheduler _scheduler; public Throw(Exception exception, IScheduler scheduler) { _exception = exception; _scheduler = scheduler; } [return: System.Runtime.CompilerServices.Nullable(new byte[] { 1, 0 })] protected override _ CreateSink(IObserver<TResult> observer) { return new _(_exception, observer); } protected override void Run([System.Runtime.CompilerServices.Nullable(new byte[] { 1, 0 })] _ sink) { sink.Run(_scheduler); } } }