concurrency.stream

Undocumented in source.

Members

Classes

StreamObjectImpl
class StreamObjectImpl(Stream)

A class extending from StreamObjectBase that wraps any Stream

Enums

ThrottleEmitLogic
enum ThrottleEmitLogic
Undocumented in source.
ThrottleTimerLogic
enum ThrottleTimerLogic
Undocumented in source.
isStream
eponymoustemplate isStream(T)
Undocumented in source.

Functions

arrayStream
auto arrayStream(T[] arr)

Stream that emits each value from the array or until cancelled

checkStream
void checkStream()

checks that T is a Stream

debounce
auto debounce(Stream s, Duration d)

debounce skips all items which are succeeded by another within the duration. Effectively it only emits items after a duration of silence

doneStream
auto doneStream()
Undocumented in source. Be warned that the author may not have intended to support it.
errorStream
auto errorStream(Exception e)
Undocumented in source. Be warned that the author may not have intended to support it.
fromStreamOp
auto fromStreamOp(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
infiniteStream
auto infiniteStream(T t)

Stream that emit the same value until cancelled

intervalStream
auto intervalStream(Duration duration)
Undocumented in source. Be warned that the author may not have intended to support it.
iotaStream
auto iotaStream(T start, T end)

Stream that emits from start..end or until cancelled

sample
auto sample(StreamBase base, StreamTrigger trigger)

Forwards the latest value from the base stream every time the trigger stream produces a value. If the base stream hasn't produces a (new) value the trigger is ignored

scan
auto scan(Stream stream, ScanFn scanFn, Seed seed)

Applies an accumulator to each value from the source

sharedStream
auto sharedStream()

A SharedStream is used for broadcasting values to zero or more receivers. Receivers can be added and removed at any time. The stream itself never completes, so receivers should themselves terminate their connection.

slide
auto slide(Stream stream, size_t window, size_t step)

slides a window over a stream, emitting all items in the window as an array. The array is reused so you must duplicate if you want to access it beyond the stream.

take
auto take(Stream stream, size_t n)

takes the first n values from a stream or until cancelled

throttleFirst
auto throttleFirst(Stream s, Duration d)

throttleFirst forwards one item and then enters a cooldown period during which it ignores items

throttleLast
auto throttleLast(Stream s, Duration d)

throttleLast starts a cooldown period when it receives an item, after which it forwards the lastest value from the cooldown period

throttling
auto throttling(Stream stream, Duration dur)
Undocumented in source. Be warned that the author may not have intended to support it.
toList
auto toList(Stream stream)

toList collects all the stream's values and emits the array as a Sender

toStreamObject
StreamObjectBase!(Stream.ElementType) toStreamObject(Stream stream)

Converts any Stream to a polymorphic StreamObject

transform
auto transform(Stream stream, Fun fun)
Undocumented in source. Be warned that the author may not have intended to support it.
via
auto via(Stream stream, Sender sender)
Undocumented in source. Be warned that the author may not have intended to support it.

Interfaces

StreamObjectBase
interface StreamObjectBase(T)

A polymorphic stream with elements of type T

Structs

SharedStream
struct SharedStream(T)
Undocumented in source.

Templates

CollectDelegate
template CollectDelegate(ElementType)

A Stream is anything that has a .collect function that accepts a callable and returns a Sender. Once the Sender is connected and started the Stream will call the callable zero or more times before one of the three terminal functions of the Receiver is called.

SchedulerType
template SchedulerType(Receiver)
Undocumented in source.
StreamProperties
template StreamProperties(Stream)
Undocumented in source.
loopStream
template loopStream(E)

Helper to construct a Stream, useful if the Stream you are modeling has a blocking loop

Meta