Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playback throws NotImplementedException when using Delay() #45

Open
CodeTao opened this issue Jan 8, 2018 · 3 comments
Open

Playback throws NotImplementedException when using Delay() #45

CodeTao opened this issue Jan 8, 2018 · 3 comments
Labels

Comments

@CodeTao
Copy link

CodeTao commented Jan 8, 2018

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();
    }
@Tuatan Tuatan added bug and removed bug labels Jan 19, 2018
@Tuatan
Copy link
Collaborator

Tuatan commented Jan 19, 2018

AFAIK there is no code in Tx that throws NotImplementedException. @CodeTao, which version of Tx and Rx are you using?

@CodeTao
Copy link
Author

CodeTao commented Jan 20, 2018

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;
        }
    ...
  }

@Tuatan Tuatan added the bug label Jan 24, 2018
@Tuatan
Copy link
Collaborator

Tuatan commented Jan 24, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants