This project is read-only.

Task.Wait(interval) is not honored

Feb 25, 2016 at 10:27 PM

I have the following code in the C# layer:
        public Task<bool> WaitTask(int interval)
            var task = Task.Factory.StartNew((() =>
                var delay = Task.Delay(interval);
                return true;

            return task;
and this is what the script is:
var promise = csObj.WaitTask(20000);
csObj.Log("--- wait  :");
csObj.Log("Result: " + promise.Result);
The code returns only after the Task execution is complete. It does not honor the wait time as in the promise.Wait(5000).

Am I missing something?

Marked as answer by PrajnanDas on 2/25/2016 at 3:11 PM
Feb 25, 2016 at 11:12 PM
promise.Result blocks until task is complete.
Feb 26, 2016 at 12:57 AM
Edited Feb 26, 2016 at 1:04 AM
This is not V8.Net related, not sure why you are posting here. That said, try using "await":

Are you saying that the timeout is not being honoured?