Posts: 4
Threads: 2
Joined: Aug 2023
Hi, I have an idea to use CancellationToken.WaitHandle to perform wait in wait class or any find operation (uiimage, orc, etc...), so we can cancel the wait manually without terminate the process.
Will it become true in further update?
Posts: 11,656
Threads: 136
Joined: Dec 2002
Can you provide one or more examples where it can be useful?
Maybe this can be used instead:
var cts = new CancellationTokenSource(1000);
Task.Run(() => { 3.s(); }).Wait(cts.Token);
I don't want to add rarely used parameters (CancellationToken) to these functions.
Posts: 4
Threads: 2
Joined: Aug 2023
I have a case like: Wait for an image, with timeout of 180 seconds. When I cancel that task(but do not want to exit process), the imageFinder still execute until reach the timeout. So it does not actually cancel.