Job results (from Receive-Job) are grouped by output type, differently than "normal" (BackgroundJob) jobs
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- powershell
- Lĩnh vực
- backend
Hướng nghiên cứu
The issue shows the behavior with Start-ThreadJob and Receive-Job on PowerShell 7.4.5 and ThreadJob 2.1.0. Start by reproducing the example and comparing its output order with Start-Job. Trace how ThreadJob collects and exposes the different output streams; done means Receive-Job preserves the order of interleaved output types.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Consider the following code which starts a ThreadJob:
$job = Start-ThreadJob -ScriptBlock {
for( $i = 0 ; $i -lt 100 ; $i++ )
{
Write-Output "output $i"
Write-Host "host output $i"
Write-Information "info output $i"
Write-Verbose "verbose output $i"
Write-Warning "warning output $i"
Start-Sleep -Seconds 5
}
}
If I receive results of the job, the output is grouped according to the type of output:
PS C:\Users\me> Receive-Job $job
output 0
output 1
output 2
WARNING: warning output 0
WARNING: warning output 1
WARNING: warning output 2
host output 0
host output 1
host output 2
PS C:\Users\me>
This is in contrast to “normal” jobs—if I switch the call out for Start-Job, the results come in a more expected order:
PS C:\Users\me> Receive-Job $job
output 0
host output 0
WARNING: warning output 0
output 1
host output 1
WARNING: warning output 1
output 2
host output 2
WARNING: warning output 2
PS C:\Users\me>
Expected behavior
I expect the output from Receive-Job of a ThreadJob to come in the same order as from a BackgroundJob.
This is because I expect to be able to use thread jobs as a "drop-in" replacement for background jobs (modulo restrictions imposed due to running in the same process, like of course you wouldn't be able to load different versions of .NET assemblies).
Actual behavior
The output from a ThreadJob is all grouped by output type (all Warnings grouped together, all host output grouped together, etc.).
Environment data
Name Value
---- -----
PSVersion 7.4.5
PSEdition Core
GitCommitId 7.4.5
OS Microsoft Windows 10.0.26290
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
PS C:\Users\me> gmo *thread*
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Binary 2.1.0 Microsoft.PowerShell.ThreadJob Start-ThreadJob
Version
7.4.5 / 2.1.0
- Ngôn ngữ chính
- PowerShell
- Star
- 37
- Fork
- 22
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PowerShell/ThreadJob
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
PowerShell/ThreadJob#59 · 1 reaction ·
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
PowerShell/ThreadJob#56 · 1 reaction ·
-
Set alias for ThreadJob command(s)Có thể đã có người làm @kilasuit đã nhận 80 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 20/100
PowerShell/ThreadJob#45 · 1 bình luận ·
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 48/100
PowerShell/ThreadJob#44 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
PowerShell/ThreadJob#43 ·
Tất cả issue của PowerShell/ThreadJob
Issue tương tự
-
Add TuneIn-DirMon in the bot listCó thể đã có người làm @liviuconcioiu đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
matomo-org/device-detector#8424 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] [Go] Ack returns nil when the server answers with a non-OK statusCó thể đã có người làm @leizhiyuan đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
apache/rocketmq-clients#1465 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
medusajs/dtc-starter#90 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
NVIDIA/flare-local-inference#90 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
zaidmukaddam/scira#261 ·