对于 Buffer 等运算符,打开和关闭边界是什么意思? [英] What is the meaning of opening and closing boundaries with regard to operators such as Buffer?
问题描述
我不明白需要打开或关闭边界的 Buffer 运算符的重载.我所指的重载是:
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?
推荐答案
它们等价于 Window
操作符(但每个窗口产生 IList
而不是 IObservable
) 记录在这里 - http:///introtorx.com/Content/v1.0.10621.0/17_SequencesOfCoincidence.html
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
我建议暂停并阅读一些目前在 Rx 上的 doco.这是一个小领域,但有很多小概念.这些的组成是理解它的关键.例如,阅读所有 IntroToRx 需要几个小时(只有 17 页).
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).
这篇关于对于 Buffer 等运算符,打开和关闭边界是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!