Skip to content

Add 2 parameters to Start-ThreadJob: timeout seconds, priority #26

Open
@kasini3000

Description

@kasini3000

Summary of the new feature / enhancement

Add 2 parameters to Start-ThreadJob: timeout seconds, priority

Proposed technical implementation details (optional)

priority:

A single asynchronous task has no timeout and no priority, It is very original.

The priority range is 1-9, and the default is 5,priority 1 will be executed first.


timeoutseconds:

For that things, I think thread-timeout is a good medicine:

like:
golang : “context.WithTimeout”
python : timeout* in threading lib

It is better to add a Boolean type of parameter : -AutoRemoveJob
whether to automatically remove threadjob after timeout,
parameter likes “receive-job -AutoRemoveJob”
In this way, users can only consider new thread and put ps1 script code.

both "ForEach-Object -Parallel" and "Start-ThreadJob" without timeout, This has seriously affected my development of "kasini3000" at present.

Powershell community do a "engine",i do a "car". the car is kasini3000 and k4t .
I love powershell. I want to give my opinion to the engine.
I hope the engine factory can transform a better engine.
I think timeoutseconds can make the ps1 script in the thread more robust.
I hope powershell will become stronger and stronger.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions