<PackageReference Include="System.Reactive" Version="6.0.1-preview.1" />

Timestamp<TSource>

sealed class Timestamp<TSource> : Producer<Timestamped<TSource>, _<TSource>>
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, 0, 1, 1, 1 })] internal sealed class Timestamp<[System.Runtime.CompilerServices.Nullable(2)] TSource> : Producer<Timestamped<TSource>, Timestamp<TSource>._> { [System.Runtime.CompilerServices.Nullable(new byte[] { 0, 1, 0, 1 })] internal sealed class _ : Sink<TSource, Timestamped<TSource>> { private readonly IScheduler _scheduler; public _(IScheduler scheduler, [System.Runtime.CompilerServices.Nullable(new byte[] { 1, 0, 1 })] IObserver<Timestamped<TSource>> observer) : base(observer) { _scheduler = scheduler; } public override void OnNext(TSource value) { ForwardOnNext(new Timestamped<TSource>(value, _scheduler.Now)); } } private readonly IObservable<TSource> _source; private readonly IScheduler _scheduler; public Timestamp(IObservable<TSource> source, IScheduler scheduler) { _source = source; _scheduler = scheduler; } [return: System.Runtime.CompilerServices.Nullable(new byte[] { 1, 0 })] protected override _ CreateSink([System.Runtime.CompilerServices.Nullable(new byte[] { 1, 0, 1 })] IObserver<Timestamped<TSource>> observer) { return new _(_scheduler, observer); } protected override void Run([System.Runtime.CompilerServices.Nullable(new byte[] { 1, 0 })] _ sink) { sink.Run(_source); } } }