2 categories:: Streams-Patterns-Events
3 related:: Classes/Stream, Classes/Event
4 summary:: A Stream that returns Events when called
6 An event stream is a normal link::Classes/Stream:: that returns events when called. (see class link::Classes/Event::). Usually, an event stream requires an event to be passed in, often the default event is used:
9 t = Pbind(\x, Pseq([1, 2, 3])).asStream; // Pbind, e.g. creates a stream
10 t.next(Event.default);
11 t.next(Event.default);
14 An event stream cannot be played directly with a clock, as it returns events and not time values. Therefore, an link::Classes/EventStreamPlayer:: is used, which replaces the event by according time value.
16 A link::Classes/Pevent:: can be used to wrap a stream in an event:
19 t = Pevent(Pbind(\x, Pseq([1,2,3])), Event.default).asStream;