Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SelectMany

Turns each event into zero or more events, each with the input event’s lifetime.

The selector returns a sequence of payloads for each input payload. Each payload in the sequence becomes an output event with the input event’s lifetime. An empty sequence drops the event, so SelectMany can filter as well as expand.

In the diagram, each event becomes as many events as its value: a:1 gives one, b:2 two and a:3 three, all with their input’s lifetime.

An overload takes (start, payload), as Select (with start time) does. SelectManyByKey also passes the stream’s key, as SelectByKey does.

See also: Select, Where, SelectByKey, SelectManyByKey