Cel*_*Cel 10 .net c# linq system.reactive
IObservable filteredStream = changes.Buffer(3);
Run Code Online (Sandbox Code Playgroud)

但是如何引入超时,TimeSpan tooLong以便只要两个值之间的间隔超过此最大值,计数就会从零重新开始?
我想这就是你所追求的。
var longGap = source.Throttle(tooLong);
var filtered = source
.Window(() => { return longGap; }) // Gives a window between every longGap
.Select(io => io.Buffer(maxItems).Where(l => l.Count == maxItems))
.Switch(); // Flattens the IObservable<IObservable<IList>> to IObservable<IList>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
436 次 |
| 最近记录: |