Tx
Tx copied to clipboard
Playback throws NotImplementedException when using Delay()
Playback.GetObservable() throws a NotImplementedException when the Delay() operator is used.
using (var playback = new Playback())
{
var evtTime = new DateTimeOffset(2018, 1, 1, 12, 0, 0);
playback.AddInput(new[] { new Timestamped<object>(evtTime, evtTime) });
playback.GetObservable<DateTimeOffset>()
.Delay(TimeSpan.FromSeconds(10), playback.Scheduler)
.Subscribe(x => Debug.WriteLine($"Data Time: {x} SchedulerTime: {playback.Scheduler.Now}"));
playback.Run();
}
AFAIK there is no code in Tx that throws NotImplementedException. @CodeTao, which version of Tx and Rx are you using?
The sample code above demonstrates the error and the NotImplementedException is thrown in the TimeSegmentScheduler as shown in the source code below.
private sealed class TimeSegmentScheduler : IScheduler
{
...
public DateTimeOffset Now
{
get
{
if (!_running)
{
throw new NotImplementedException();
}
return _historical.Clock;
}
...
}
Seems like the Delay
is not supported at the moment since it relies on Now
stamp from the scheduler, and at the time of query construction the scheduler is not initialized yet.