Task.Wait(interval) is not honored

Feb 25, 2016 at 9: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 10:12 PM
promise.Result blocks until task is complete.
Feb 25, 2016 at 11:57 PM
Edited Feb 26, 2016 at 12:04 AM
This is not V8.Net related, not sure why you are posting here. That said, try using "await": https://msdn.microsoft.com/en-us/library/hh156528.aspx?f=255&MSPPError=-2147217396

Are you saying that the timeout is not being honoured?