What is the meaning of opening and closing boundaries with regard to operators such as Buffer?

房东的猫 提交于 2019-12-10 22:44:41

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!