proxb / PoshRSJob

Provides an alternative to PSjobs with greater performance and less overhead to run commands in the background, freeing up the console and allowing throttling on the jobs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ordered aspect doesn't work

opened this issue · comments

EDIT: It will be fixed by: #180

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Output is thrown at the console at the end of all jobs.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
https://i.imgur.com/bXKco8j.mp4

1..10|Start-RSJob {
    if (1 -BAND $_){
        "First ($_)"
    }Else{
        Start-sleep -seconds 2
        "Last ($_)"
    }
}|Wait-RSJob|Receive-RSJob|ForEach{"I am $($_)"}

What is the expected behavior?
Output should be ordered:
Pic

Which versions of Powershell and which OS are affected by this issue? Did this work in previous versions of our scripts?
PSVersion 5.1.17618.1000
PSEdition Desktop
BuildVersion 10.0.17618.1000

the right word sould be "ordered". there is no problem with streaming in this example :)

but, yes, since my changes to Get-RSJob (for speedup)
jobs ordered by start time, (by id) , not finishing time

If this is undesired change, it can be fixed by switching $PoshRS_Jobs from list to hash
btw, may be this will be another speedup for long job lists
if @proxb agree that it should be fixed I can try to prepare PR