How to operate VirtualTimeScheduler with NodaTime #2196
Replies: 2 comments 14 replies
-
Hi! Glad you find VirtualTime interesting - I'm a firm believer that it's one of Rx's superpowers 👊 - most people use it in test scenarios - and this is covered in the Intro to Rx .NET book here: https://introtorx.com/chapters/testing-reactive-extensions-for-dotnet BUT we've found really good use cases for using it to run "simulations" where rather than having to wait for real time to process, we can use virtual time to process historic data for "what if" type analysis. So, what would NodaTime bring to the party that isn't already covered by the existing API? |
Beta Was this translation helpful? Give feedback.
-
Overall, at present, I think I have what I need to move forward. |
Beta Was this translation helpful? Give feedback.
-
The prima facie idea of a
VirtualTimeScheduler
seems interesting. Is it possible to use that using aNodaTime
substrate? That is, perhaps leveragingInstant
or perhapsDuration
, just spit balling there, throwing mud on the wall. Whatever theTAbsolute
andTRelative
should be, along these lines.TAbsolute
of course beingwhere TAbsolute : IComparable<TAbsolute>
, which I think eitherDuration
orInstant
would be. Not sure what, if anything,TRelative
has to be, presumably as a function of a periodicTAbsolute
.Beta Was this translation helpful? Give feedback.
All reactions