Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A new Test-PodeTaskInvoked function #1037

Open
Badgerati opened this issue Nov 29, 2022 · 1 comment
Open

A new Test-PodeTaskInvoked function #1037

Badgerati opened this issue Nov 29, 2022 · 1 comment

Comments

@Badgerati
Copy link
Owner

Test if some task is currently being invoked/running - by checking all currently running task processes with that task’s name.

Possibly also add a Wait function as well, to wait for the task to no longer have any invoked processes?

# check if TaskA has any invoked processes
Test-PodeTaskInvoked -Name TaskA

# wait for TaskA to be idle(?) and have no invoked processes
Wait-PodeTaskIdle? -Name TaskA

# when TaskB is invoked, it will automatically wait for any TaskA processes to complete
New-PodeTask -Name TaskB -WaitOn TaskA

# TaskC here could be sequential, in which case only one can run at a time?
New-PodeTask -Name TaskC -Type [Parallel | Sequential]

Update Get-PodeTask, or just the Task object, to have a ProcessCount or Processes array? One is just a count of current invoked processes and the other an array of invoked process names.

Or: Get-PodeTaskProcesses

Could we differentiate between a Queued process, and an Active one? Like a Queued one is one just created, but an Active one is one now running in the runspace?

@Badgerati
Copy link
Owner Author

Another function I thought was in the list above:

  • Get-PodeTaskProcess - this will return an invoked task process object, similar to the object returned by Invoke-PodeTask

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

1 participant