<PackageReference Include="System.Reactive" Version="6.0.0-preview.13" />
ThrowImmediate<TSource>
using System.
Reactive.
Disposables;
using System.
Runtime.
CompilerServices;
namespace System.
Reactive.
Linq.
ObservableImpl
{
[
System.
Runtime.
CompilerServices.
NullableContext(
1)]
[
System.
Runtime.
CompilerServices.
Nullable(
new byte[] {
0,
1
})]
internal sealed class ThrowImmediate<[
System.
Runtime.
CompilerServices.
Nullable(
2)]
TSource> :
BasicProducer<
TSource>
{
private readonly Exception _exception;
public ThrowImmediate(
Exception exception)
{
_exception =
exception;
}
protected override IDisposable Run(
IObserver<
TSource>
observer)
{
observer.
OnError(
_exception);
return Disposable.
Empty;
}
}
}