I am trying to understand how the following scenario could be implemented using reactive extensions. Other solutions that I have been looking at involve managing a series of timers… something that I am looking to avoid if possible.
Scenario
A stream of “ActionRequests” occurring. The ActionRequest’s streaming in are from different object sources. I am only interested in picking off the most recent ActionRequest once requests have stopped coming in from a specific source for a period of x seconds
So breaking that down.
public class ActionRequest
{
public ActionRequest(Guid quoteId, DateTime now)
{
QuoteId = quoteId;
RequestTimestamp = now;
}
public Guid QuoteId { get; set; }
public DateTime RequestTimestamp { get; set; }
}
Any thoughts on this would be appreciated.
Answer was provided in RX Forums by Richard Hein.
Short version of the answer is below. A more complete sample has been added to the thread in the RX forums.