Treatment trigger

flow/vec/i16::trigger


Inputs

⇥ stream: Stream<Vec<i16>>

Outputs

↦ end: Block<void>
↦ first: Block<Vec<i16>>
↦ last: Block<Vec<i16>>
↦ start: Block<void>


Trigger on Vec<i16> stream start and end.

Emit start when a first value is send through the stream. Emit end when stream is finally over.

Emit first with the first vector coming in the stream. Emit last with the last vector coming in the stream.

ℹ️ start and first are always emitted together. If the stream only contains one vector, first and last both contains it. If the stream never transmit any data before being ended, only end is emitted.

graph LR
     T("trigger()")
     B["[🟥 🟥] … [🟨 🟨] [🟨 🟨] [🟨 🟨] … [🟩 🟩]"] -->|stream| T
     
     T -->|start| S["〈🟦〉"]
     T -->|first| F["〈[🟩 🟩]〉"]
     T -->|last| L["〈[🟥 🟥]〉"]
     T -->|end| E["〈🟦〉"]

     style B fill:#ffff,stroke:#ffff
     style S fill:#ffff,stroke:#ffff
     style F fill:#ffff,stroke:#ffff
     style L fill:#ffff,stroke:#ffff
     style E fill:#ffff,stroke:#ffff