Pipeline Streaming Module

This topic contains 1 reply, has 2 voices, and was last updated by  Don Jones 1 year ago.

  • Author
  • #70799

    Hi, I'm giving a PowerShell class and one of the students asked a question related to the modes of processing data within a powershell pipeline (streaming vs. sequential mode)

    Given a typical pipeline like:

    Get-ChildItem | Sort-Object Length | Select-Object Length, Name | ForEach { ... }

    Will Sort-Object switch the entire pipeline to sequential processing meaning that all pipeline commands are executed one at a time

    ... or ...

    Will only Sort-Object hand over its entire (sorted) results to the next command while the rest of the pipeline remains in streaming mode or rather real-time processing.


  • #70802

    Don Jones

    There's no way to "switch" the pipeline. Sort merely declines to emit anything until it's gotten the all-clear that nothing more is coming. It then emits its results on object at a time, and they continue to stream down the pipeline in that fashion unless someone else "blocks."

    There is no "mode" for the pipeline.

You must be logged in to reply to this topic.