{"id":174799,"date":"2013-03-30T18:55:03","date_gmt":"2013-03-30T14:55:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=174799"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=174799","title":{"rendered":"<span class=\"post_title\">\u041e\u043d\u0438 \u0441\u043c\u0435\u044e\u0442\u0441\u044f \u043d\u0430\u0434 \u0442\u0432\u043e\u0438\u043c\u0438 \u043a\u043e\u043b\u0431\u0435\u043a\u0430\u043c\u0438 \u0438\u043b\u0438 async\/await \u00ab\u0434\u043b\u044f \u0431\u0435\u0434\u043d\u044b\u0445\u00bb<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0423 \u0432\u0430\u0441 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 .NET 4.0 \u0438 \u0432\u0430\u043c \u043d\u0430\u0434\u043e\u0435\u043b\u0430 \u00ab\u043b\u0430\u043f\u0448\u0430\u00bb \u0438\u0437 \u043a\u043e\u043b\u0431\u0435\u043a\u043e\u0432? \u0412\u044b \u0431\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c async\/await \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u043d\u043e \u0442\u0438\u043c\u043b\u0438\u0434 \u0433\u0440\u043e\u0437\u0438\u0442 \u043d\u0435\u0431\u0435\u0441\u043d\u043e\u0439 \u043a\u0430\u0440\u043e\u0439 \u0437\u0430 \u0441\u043c\u0435\u043d\u0443 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b? \u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0430\u0442\u0447\u0430 \u043d\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0438 \u0441\u0442\u0443\u0434\u0438\u044e \u0434\u043b\u044f \u0432\u0430\u0441 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c, \u0442\u043e \u0432\u0430\u043c <a href=\"http:\/\/blogs.msdn.com\/b\/bclteam\/archive\/2012\/10\/22\/using-async-await-without-net-framework-4-5.aspx\">\u0441\u044e\u0434\u0430<\/a>. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/451\/896\/6da\/4518966da9d6f146434889bcfadb3ee8.jpg\"\/><br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h5>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043e\u0440\u0438\u0438<\/h5>\n<p>  Async-\u043c\u0435\u0442\u043e\u0434 \u044d\u0442\u043e <a href=\"http:\/\/ru.wikipedia.org\/wiki\/%D0%A1%D0%BE%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%BC%D0%B0\">\u0441\u043e\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c await, \u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u044d\u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f(\u0430\u0432\u0442\u043e\u0440 <a href=\"http:\/\/blogs.msdn.com\/b\/pfxteam\/archive\/2013\/01\/28\/psychic-debugging-of-async-methods.aspx\">\u0437\u043d\u0430\u0435\u0442<\/a>, \u0447\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 await \u0438 \u0447\u0442\u043e \u00ab\u043e\u0436\u0438\u0434\u0430\u0442\u044c\u00bb \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b Task). \u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0434\u043e\u0442\u043d\u0435\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 yield. \u042d\u0442\u0438\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043c\u044b \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f.<\/p>\n<h5>\u041a\u043e\u043d\u0446\u0435\u043f\u0442<\/h5>\n<p>  \u0425\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a \u043d\u0430 C# 5.0, \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0442\u0430\u043a \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u041d\u043e \u0435\u0441\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:  <\/p>\n<pre><code class=\"cs\">private IEnumerable Login(...) {              \/\/ ...              \/\/ get user id, if not specified             if (string.IsNullOrEmpty(uid))             {                 var getUserIdTask = \u0441lient.GetUserId(...); yield return getUserIdTask; \/\/ await                 uid= getUserIdTask.Result.uid;             }              \/\/ login             var loginTask = \u0441lient.Login(...); yield return loginTask; \/\/ await             var sessionId = loginTask.Result.SessionId;              \/\/ getting user's profile             var getUserInfoTask = \u0441lient.GetUserInfo(...); yield return getUserInfoTask; \/\/ await             var userInfo = getUserInfoTask.Result;                         \/\/ ...                          yield return userInfo; \/\/ return } <\/code><\/pre>\n<p>  \u0412\u0441\u0451 \u0447\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 yield return \u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u043c Task \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f async-\u043c\u0435\u0442\u043e\u0434\u0430.<\/p>\n<h5>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h5>\n<p>  \u041a\u043e\u0434 \u043b\u0435\u0436\u0438\u0442 <a href=\"http:\/\/pastebin.com\/s23gWEzj\">\u0442\u0443\u0442<\/a>. <br \/>  \u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0441\u0442\u043e\u0439:   <\/p>\n<ol>\n<li>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 Task \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u043c\u0443<\/li>\n<li>\u0412\u0440\u0430\u0449\u0430\u0435\u043c \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0432\u0435\u0440\u043d\u0443\u043b\u0441\u044f Task, \u0442\u043e \u0436\u0434\u0435\u043c \u0435\u0433\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 ContinueWith \u0441 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u043c \u043a \u0448\u0430\u0433\u0443 \u21162<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0432\u0435\u0440\u043d\u0443\u043b\u0430\u0441\u044c \u043e\u0448\u0438\u0431\u043a\u0430, \u0442\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c Exception \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0432\u043e\u0433\u043e Task<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0432\u0435\u0440\u043d\u0443\u043b\u043e\u0441\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0442\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u043a\u043e\u043d\u0435\u0432\u043e\u0439 Task \u0441 \u0434\u0430\u043d\u043d\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440 \u043a\u043e\u043d\u0447\u0438\u043b\u0441\u044f, \u0442\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u043a\u043e\u043d\u0435\u0432\u043e\u0439 Task \u0441\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c<\/li>\n<\/ol>\n<p>  \u0412\u043e \u0432\u0441\u0435\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d Dispose, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0432 \u0431\u043b\u043e\u043a\u0430\u0445 using \u0438 try\/finally.<\/p>\n<p>  \u041d\u0430\u0447\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0432 \u043c\u0435\u0442\u043e\u0434 <b>FromIterator<\/b>:  <\/p>\n<pre><code class=\"cs\">private IEnumerable Login(...) { ... }  Task loginTask = TaskUtils.FromIterator(this.Login(...)); \/\/ \u0438\u043b\u0438 \u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c Task&lt;UserInfo&gt; loginTask = TaskUtils.FromIterator&lt;UserInfo&gt;(this.Login(...));  <\/code><\/pre>\n<p>  \u041e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c:  <\/p>\n<ul>\n<li>state \u2014 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u043f\u0430\u0434\u0435\u0442 \u0432 <a href=\"http:\/\/msdn.microsoft.com\/ru-ru\/library\/system.threading.tasks.task.asyncstate.aspx\">Task.AsyncState<\/a><\/li>\n<li>creationFlags \u2014 <a href=\"http:\/\/msdn.microsoft.com\/ru-ru\/library\/system.threading.tasks.taskcreationoptions.aspx\">TaskCreationOptions<\/a> \u0434\u043b\u044f \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 <b>TaskCreationOptions.LongRunning<\/b> \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c \u0447\u0442\u043e \u0432\u044b <b>\u043e\u0447\u0435\u043d\u044c<\/b> \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043f\u043e\u0442\u043e\u043a \u0438 \u0432\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435<\/li>\n<li>cancellationToken \u2014 \u0442\u043e\u043a\u0435\u043d \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f async-\u043c\u0435\u0442\u043e\u0434\u0430, \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432\u0433\u043b\u0443\u0431\u044c \u0432\u0435\u0437\u0434\u0435, \u0433\u0434\u0435 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e<\/li>\n<\/ul>\n<h5>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h5>\n<p>  <\/p>\n<h6>\u041f\u043b\u044e\u0441\u044b:<\/h6>\n<p>  <\/p>\n<ul>\n<li>\u041a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u0435\u043d\u044c\u043a\u043e \u0438 \u0447\u0438\u0441\u0442\u043e<\/li>\n<li>\u041c\u043e\u0436\u043d\u043e \u043d\u0435 \u0431\u043e\u044f\u0442\u044c\u0441\u044f \u0437\u0430 unmanaged \u0440\u0435\u0441\u0443\u0440\u0441\u044b, using, try\/catch \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442<\/li>\n<li>\u041d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0430\u0442\u0447\u0435\u0439 \u0438 \u0434\u043e\u043f. \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a<\/li>\n<li>\u0411\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 Mono<\/li>\n<\/ul>\n<h6>\u041c\u0438\u043d\u0443\u0441\u044b:<\/h6>\n<p>  <\/p>\n<ul>\n<li>Async-\u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 IEnumerable, \u0430 \u043d\u0435 Task. \u0418\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 Task.<\/li>\n<li>\u00ab\u041e\u0436\u0438\u0434\u0430\u0442\u044c\u00bb \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b Task<\/li>\n<li>\u041e\u0448\u0438\u0431\u043a\u0438 \u00ab\u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0445\u00bb \u0437\u0430\u0434\u0430\u0447 \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 try\/catch(\u043c\u043e\u0436\u043d\u043e \u0447\u0435\u0440\u0435\u0437 ContinueWith). \u041f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 \u0432 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435, \u0443 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f Exception \u0438 \u043f\u043e\u0442\u043e\u043a \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u043e\u0441\u0435\u0449\u0430\u0435\u0442 async-\u043c\u0435\u0442\u043e\u0434.<\/li>\n<li>\u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438(TaskBuilder) \u043d\u0435 \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u0435\u0442 \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u0441\u0435\u0431\u044f, \u043a\u0440\u043e\u043c\u0435 \u0442\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 ContinueWith \u0432 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445, \u0438 \u0435\u0441\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0438 \u0435\u0433\u043e GC<\/li>\n<\/ul>\n<p>  \u0411\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043c\u0438\u043d\u0443\u0441\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0431\u043e\u0440\u043e\u0442\u044c \u0442\u0435\u043c \u0438\u043b\u0438 \u0438\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c.<\/p>\n<p>  \u041e\u0448\u0438\u0431\u043a\u0438 \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u041b\u0421.<br \/>  <a href=\"http:\/\/pastebin.com\/s23gWEzj\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/a>.    \t \t\t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/174799\/\"> http:\/\/habrahabr.ru\/post\/174799\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0423 \u0432\u0430\u0441 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 .NET 4.0 \u0438 \u0432\u0430\u043c \u043d\u0430\u0434\u043e\u0435\u043b\u0430 \u00ab\u043b\u0430\u043f\u0448\u0430\u00bb \u0438\u0437 \u043a\u043e\u043b\u0431\u0435\u043a\u043e\u0432? \u0412\u044b \u0431\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c async\/await \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u043d\u043e \u0442\u0438\u043c\u043b\u0438\u0434 \u0433\u0440\u043e\u0437\u0438\u0442 \u043d\u0435\u0431\u0435\u0441\u043d\u043e\u0439 \u043a\u0430\u0440\u043e\u0439 \u0437\u0430 \u0441\u043c\u0435\u043d\u0443 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b? \u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0430\u0442\u0447\u0430 \u043d\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0438 \u0441\u0442\u0443\u0434\u0438\u044e \u0434\u043b\u044f \u0432\u0430\u0441 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c, \u0442\u043e \u0432\u0430\u043c <a href=\"http:\/\/blogs.msdn.com\/b\/bclteam\/archive\/2012\/10\/22\/using-async-await-without-net-framework-4-5.aspx\">\u0441\u044e\u0434\u0430<\/a>. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/451\/896\/6da\/4518966da9d6f146434889bcfadb3ee8.jpg\"\/>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-174799","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/174799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=174799"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/174799\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=174799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=174799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=174799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}