Treatment trigger

flow/vec/i128::trigger


Inputs

⇥ stream: Stream<Vec<i128>>

Outputs

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


Trigger on Vec<i128> 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