Mercurial > pub > ImplabNet
comparison Implab.Test/AsyncTests.cs @ 106:d4e38929ce36 v2
promises refactoring
author | cin |
---|---|
date | Mon, 10 Nov 2014 18:00:28 +0300 |
parents | 4d308952fd5e |
children | 2573b562e328 |
comparison
equal
deleted
inserted
replaced
105:4d308952fd5e | 106:d4e38929ce36 |
---|---|
424 .Sleep(1, "Hi, HAL!") | 424 .Sleep(1, "Hi, HAL!") |
425 .Chain(x => { | 425 .Chain(x => { |
426 hemStarted.Set(); | 426 hemStarted.Set(); |
427 // запускаем две асинхронные операции | 427 // запускаем две асинхронные операции |
428 var result = PromiseHelper | 428 var result = PromiseHelper |
429 .Sleep(10000, "HEM ENABLED!!!") | 429 .Sleep(100000000, "HEM ENABLED!!!") |
430 .Then(s => pSurvive.Resolve(false)); | 430 .Then(s => { |
431 pSurvive.Resolve(false); | |
432 return s; | |
433 }); | |
431 | 434 |
432 result | 435 result |
433 .Cancelled(() => pSurvive.Resolve(true)); | 436 .Cancelled(() => pSurvive.Resolve(true)); |
434 | 437 |
435 return result; | 438 return result; |