Window

See also

  • Official ReactiveX documentation: Window
Observable.window(window_openings=None, window_closing_selector=None)

Projects each element of an observable sequence into zero or more windows.

Keyword Arguments:
 
  • window_openings (Observable) – Observable sequence whose elements denote the creation of windows.
  • window_closing_selector (types.FunctionType, optional) – A function invoked to define the closing of each produced window. It defines the boundaries of the produced windows (a window is started when the previous one is closed, resulting in non-overlapping windows).
Returns:

An observable sequence of windows.

Return type:

(Observable)

../../_images/window.png ../../_images/window1.cs.png ../../_images/window1.net.png ../../_images/window1.png ../../_images/window1.py.png ../../_images/window2.net.png ../../_images/window2.ocs.png ../../_images/window2.png ../../_images/window3.net.png ../../_images/window3.png ../../_images/window4.net.png ../../_images/window4.png ../../_images/window5.net.png ../../_images/window5.png ../../_images/window5.s.png ../../_images/window6.net.png ../../_images/window6.png ../../_images/window6.s.png ../../_images/window7.net.png ../../_images/window7.png ../../_images/window7.s.png ../../_images/window8.b.png ../../_images/window8.png
Observable.window_with_count(count, skip=None)

Projects each element of an observable sequence into zero or more windows which are produced based on element count information.

Example:

xs.window_with_count(10)
xs.window_with_count(10, 1)
Parameters:
  • count (int) – Length of each window.
  • skip (int, optional) – consecutive windows. If not specified, defaults to the count.
Returns:

an observable sequence of windows.

Return type:

Observable

../../_images/windowWithCount3.png ../../_images/windowWithCount4.png ../../_images/window_with_count3.png ../../_images/window_with_count4.png
Observable.window_with_time(timespan, timeshift=None, scheduler=None)
../../_images/windowWithTime5.png ../../_images/windowWithTime7.png ../../_images/window_with_time5.png ../../_images/window_with_time5.py.png ../../_images/window_with_time7.png ../../_images/window_with_time7.py.png
Observable.window_with_time_or_count(timespan, count, scheduler=None)
../../_images/window_with_time_or_count.png ../../_images/windowWithTimeOrCount6.png