You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Delay operator doesn't work under WpfDispatcherTimerProvider.
I think, self.timer.InvokeOnce(self.dueTime - elapsed); is called in Delay<T>._Delay.DrainMessages, but after that, timer.Stop(); is called in WpfDispatcherTimerProviderTimer.Timer_Tick, so it may be unintended behavior.
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
WpfProviderInitializer.SetDefaultObservableSystem(ex => { });
}
protected override void OnActivated(EventArgs e)
{
base.OnActivated(e);
Observable.Return(Unit.Default)
.Delay(TimeSpan.FromSeconds(1), TimeProvider.System)
.Subscribe(_ => Debug.WriteLine("This works fine"));
Observable.Return(Unit.Default)
.Delay(TimeSpan.FromSeconds(1))
.Subscribe(_ => Debug.WriteLine("but here is not reached"));
}
}
The text was updated successfully, but these errors were encountered:
Delay
operator doesn't work underWpfDispatcherTimerProvider
.I think,
self.timer.InvokeOnce(self.dueTime - elapsed);
is called inDelay<T>._Delay.DrainMessages
, but after that,timer.Stop();
is called inWpfDispatcherTimerProviderTimer.Timer_Tick
, so it may be unintended behavior.The text was updated successfully, but these errors were encountered: