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
The behavior of Timeout and TimeoutFrame immediately after calling Subscribe() appears to be inconsistent.
This issue is raised for confirmation in case this behavior is unintended.
TimeoutFrame starts its timer immediately upon subscription. As a result, it times out even if OnNext is never issued.
However, Timeout does not start its timer until OnNext is issued at least once. This means that if OnNext is never issued, the timer will wait indefinitely.
For comparison, UniRx's Timeout starts the timer immediately after subscription.
// R3.Timeout, using NUnitusingvarsubject=newR3.Subject<int>();varresults=subject.Timeout(TimeSpan.FromMilliseconds(100),TimeProvider.System).Materialize().ToLiveList();// not timeoutawaitTask.Delay(TimeSpan.FromMilliseconds(300));// No messages received (subscription is still active)CollectionAssert.IsEmpty(results);
// R3.TimeoutFrame, using NUnitvarfakeFrameProvider=newFakeFrameProvider();usingvarsubject=newR3.Subject<int>();varresults=subject.TimeoutFrame(3,fakeFrameProvider).Materialize().ToLiveList();// TimeoutfakeFrameProvider.Advance(5);Assert.AreEqual(R3.NotificationKind.OnCompleted,results[0].Kind);Assert.IsInstanceOf<TimeoutException>(results[0].Error);
// UniRx.Timeout, using NUnitusingvarsubject=newUniRx.Subject<int>();varresults=newList<UniRx.Notification<int>>();subject.Timeout(TimeSpan.FromMilliseconds(100)).Materialize().Subscribe(results.Add);// TimeoutawaitTask.Delay(TimeSpan.FromMilliseconds(200));Assert.AreEqual(UniRx.NotificationKind.OnError,results[0].Kind);Assert.IsInstanceOf<TimeoutException>(results[0].Exception);
The text was updated successfully, but these errors were encountered:
Thank you.
In R3, we were thinking of standardizing the timer initialization to occur at the first OnNext across the board.
For example, this applies to Chunk(TimeSpan) and ChunkFrame.
Therefore, I believe the current behavior of TimeoutFrame is a bug, and I'd like to fix it.
I understand that the behavior on the Timeout side is correct and the TimeoutFrame side is currently wrong.
I will keep that in mind for now and use it.
The behavior of
Timeout
andTimeoutFrame
immediately after callingSubscribe()
appears to be inconsistent.This issue is raised for confirmation in case this behavior is unintended.
TimeoutFrame
starts its timer immediately upon subscription. As a result, it times out even if OnNext is never issued.However,
Timeout
does not start its timer until OnNext is issued at least once. This means that if OnNext is never issued, the timer will wait indefinitely.For comparison, UniRx's Timeout starts the timer immediately after subscription.
The text was updated successfully, but these errors were encountered: