Tyrrrz / CliWrap

Library for running command-line processes
MIT License
4.33k stars 266 forks source link

Process priority #104

Closed alex6dj closed 3 years ago

alex6dj commented 3 years ago

Exist any way to set the process base priority before start.

Tyrrrz commented 3 years ago

Not at the moment.

alex6dj commented 3 years ago

Maybe this is a question for another issue, but. Why the Process Id returned by the CommandTask after executing ExecuteAsync is not the same of the executed process.

Tyrrrz commented 3 years ago

It is the same. Maybe your process spawns another p rocess.

alex6dj commented 3 years ago

Yes, you are right. I didn't notice that cmd.Observe already start the process execution. 😕 Now I'm facing another problem (not really a problem). If I use the Observable path I can't access the process Id 😥. Just in case. I m trying to get the process id to change priority wich is my main problem. But I like the reactive approach because my app is mostly reactive build.

Tyrrrz commented 3 years ago

With the IObservable approach, the process is started when an Observer subscribes. You can the process ID by listening to the StartedCommandEvent.

alex6dj commented 3 years ago

You are right again. StartedCommandEvent contains the id. Now with that I can get the process and change the priority. This solve the issue until a more direct approach get supported. Thanks for the help and for this awesome piece of tool.