Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cancellable wait or find
#1
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?
#2
Can you provide one or more examples where it can be useful?

Maybe this can be used instead:
Code:
Copy      Help
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.
#3
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.


Forum Jump:


Users browsing this thread: 1 Guest(s)