Table of Contents

Class SessionWindowExtensions

Namespace
Scaleout.Streaming.TimeWindowing.Linq
Assembly
Scaleout.Streaming.TimeWindowing.dll

Provides extension method for session windowing.

public static class SessionWindowExtensions
Inheritance
SessionWindowExtensions
Inherited Members

Methods

ToSessionWindows<TSource>(IEnumerable<TSource>, Func<TSource, DateTime>, TimeSpan)

Transforms a collection into an enumerable collection of session windows. The source collection must be sorted chronologically.

public static IEnumerable<ITimeWindow<TSource>> ToSessionWindows<TSource>(this IEnumerable<TSource> source, Func<TSource, DateTime> timestampSelector, TimeSpan idleThreshold)

Parameters

source IEnumerable<TSource>

The sequence of elements to transform.

timestampSelector Func<TSource, DateTime>

A function to extract a timestamp from an element.

idleThreshold TimeSpan

Maximum allowed time gap between elements before a new session window is started.

Returns

IEnumerable<ITimeWindow<TSource>>

An enumerable set of ITimeWindow<TElement> collections.

Type Parameters

TSource

The type of objects in the source collection.