I have a 'source' that sends items to a target over the network. In order to track the connection status of the target, whenever there are no items to send, the source should send a 'keepalive' signal every TimeSpan.
|time>
source x----x---x--x--------------------------x---x---x-x--x
|time>|time>|time>
keepalive -------------------o-----o-----o-----o---------------
When source is silent for 'time', keepalive triggers once every 'time'.
That isn't too hard, but I'm trying to work out how to make it work when the length of the TimeSpan also comes from an IObservable source...
times t1---------------t2----------------------------------
|t1> |.t2.>
source -----------x--x--x---x-------------------------x----x
|t1>|t1> |.t2.>|.t2.>|.t2.>
keepalive ---o---o--------------------o-----o-----o-----o------
When source is silent for 't1', keepalive triggers once every 't1', when
new time t2 is provided, the timeout and keepalive period is updated.