Pipeline Streaming Module

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Don Jones Don Jones 1 week ago.

  • Author
    Posts
  • #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.

    Thanks

  • #70802
    Profile photo of Don Jones
    Don Jones
    Keymaster

    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.