问题
I do not understand the overloads of the Buffer operator that require an opening or closing boundary. The overloads I am refering to are:
public static IObservable<IList<TSource>> Buffer<TSource,
TBufferClosing>(this IObservable<TSource> source,
Func<IObservable<TBufferClosing>> bufferClosingSelector)
public static IObservable<IList<TSource>> Buffer<TSource,
TBufferBoundary>(this IObservable<TSource> source,
IObservable<TBufferBoundary> bufferBoundaries)
public static IObservable<IList<TSource>> Buffer<TSource,
TBufferOpening, TBufferClosing>(this IObservable<TSource> source,
IObservable<TBufferOpening> bufferOpenings, Func<TBufferOpening,
IObservable<TBufferClosing>> bufferClosingSelector)
Could you please explain what the meaning of these boundaries is with an example?
回答1:
They are equivalent to the Window
operators (but each window yields IList<T>
instead of IObservable<T>
) that are documented here - http://introtorx.com/Content/v1.0.10621.0/17_SequencesOfCoincidence.html
I would suggest pausing and reading some of the doco that is currently out there on Rx. It is a small domain, but with lots of little concepts. The composition of these is the key to understanding it. Reading all of IntroToRx for example should take a few hours(it is only 17 pages).
来源:https://stackoverflow.com/questions/37824033/what-is-the-meaning-of-opening-and-closing-boundaries-with-regard-to-operators-s