{"action":"created","comment":{"url":"https://api.github.com/repos/phplego/kotlin.su/pulls/comments/107914186","pull_request_review_id":28916279,"id":107914186,"diff_hunk":"@@ -0,0 +1,386 @@\n+---\n+type: doc\n+layout: reference\n+category: \"Syntax\"\n+title: \"Сопрограммы (coroutines)\"\n+menuLabel: \"Сопрограммы\"\n+url: https://kotlinlang.ru/docs/reference/coroutines.html\n+---\n+\n+<!-- # Coroutines -->\n+# Сопрограммы\n+\n+<!-- > Coroutines are *experimental* in Kotlin 1.1. See details [below](#experimental-status-of-coroutines) \n+ {:.note} -->\n+\n+> Сопрограммы *экспериментальная* возможность Kotlin 1.1. [Подробнее](#экспериментальный-статус-сопрограмм) \n+{:.note}\n+\n+<!-- Some APIs initiate long-running operations (such as network IO, file IO, CPU- or GPU-intensive work, etc) and require the caller to block until they complete. Coroutines provide a way to avoid blocking a thread and replace it with a cheaper and more controllable operation: *suspension* of a coroutine.\n+ \n+ Coroutines simplify asynchronous programming by putting the complications into libraries. The logic of the program can be expressed *sequentially* in a coroutine, and the underlying library will figure out the asynchrony for us. The library can wrap relevant parts of the user code into callbacks, subscribe to relevant events, schedule execution on different threads (or even different machines!), and the code remains as simple as if it was sequentially executed.   \n+ \n+ Many asynchronous mechanisms available in other languages can be implemented as libraries using Kotlin coroutines. This includes [`async`/`await`](https://github.com/Kotlin/kotlinx.coroutines/blob/master/coroutines-guide.md#composing-suspending-functions) from C# and ECMAScript, [channels](https://github.com/Kotlin/kotlinx.coroutines/blob/master/coroutines-guide.md#channels) and [`select`](https://github.com/Kotlin/kotlinx.coroutines/blob/master/coroutines-guide.md#select-expression) from Go, and [generators/`yield`](#generators-api-in-kotlincoroutines) from C# and Python. See the description [below](#standard-apis) for libraries providing such constructs. -->\n+\n+Некоторые API запускают долгие операции (такие как взаимодействие по сети, операции с файлом, операции нагружающие CPU или GPU, и т.д.) и обязывают заблокировать вызывающий поток, пока они не будут завершены. Сопрограммы предоставляют способ избежать блокирование потока и заменить блокировку на более дешёвую и управляемую операцию: *приостановка (suspension)* сопрограммы.","path":"coroutines.md","position":25,"original_position":25,"commit_id":"9ca19423b96e1df801426fbe8455d50fc86b91ed","original_commit_id":"9ca19423b96e1df801426fbe8455d50fc86b91ed","user":{"login":"phplego","id":3162688,"avatar_url":"https://avatars2.githubusercontent.com/u/3162688?v=3","gravatar_id":"","url":"https://api.github.com/users/phplego","html_url":"https://github.com/phplego","followers_url":"https://api.github.com/users/phplego/followers","following_url":"https://api.github.com/users/phplego/following{/other_user}","gists_url":"https://api.github.com/users/phplego/gists{/gist_id}","starred_url":"https://api.github.com/users/phplego/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phplego/subscriptions","organizations_url":"https://api.github.com/users/phplego/orgs","repos_url":"https://api.github.com/users/phplego/repos","events_url":"https://api.github.com/users/phplego/events{/privacy}","received_events_url":"https://api.github.com/users/phplego/received_events","type":"User","site_admin":false},"body":"операции с файлом - как-то режет глаз, может быть лучше \"файловые операции\"?","created_at":"2017-03-24T14:26:41Z","updated_at":"2017-03-24T14:26:42Z","html_url":"https://github.com/phplego/kotlin.su/pull/25#discussion_r107914186","pull_request_url":"https://api.github.com/repos/phplego/kotlin.su/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/phplego/kotlin.su/pulls/comments/107914186"},"html":{"href":"https://github.com/phplego/kotlin.su/pull/25#discussion_r107914186"},"pull_request":{"href":"https://api.github.com/repos/phplego/kotlin.su/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/phplego/kotlin.su/pulls/25","id":112440968,"html_url":"https://github.com/phplego/kotlin.su/pull/25","diff_url":"https://github.com/phplego/kotlin.su/pull/25.diff","patch_url":"https://github.com/phplego/kotlin.su/pull/25.patch","issue_url":"https://api.github.com/repos/phplego/kotlin.su/issues/25","number":25,"state":"open","locked":false,"title":"Перевод coroutines.md","user":{"login":"chipnesh","id":17617519,"avatar_url":"https://avatars1.githubusercontent.com/u/17617519?v=3","gravatar_id":"","url":"https://api.github.com/users/chipnesh","html_url":"https://github.com/chipnesh","followers_url":"https://api.github.com/users/chipnesh/followers","following_url":"https://api.github.com/users/chipnesh/following{/other_user}","gists_url":"https://api.github.com/users/chipnesh/gists{/gist_id}","starred_url":"https://api.github.com/users/chipnesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chipnesh/subscriptions","organizations_url":"https://api.github.com/users/chipnesh/orgs","repos_url":"https://api.github.com/users/chipnesh/repos","events_url":"https://api.github.com/users/chipnesh/events{/privacy}","received_events_url":"https://api.github.com/users/chipnesh/received_events","type":"User","site_admin":false},"body":"Перевод coroutines.md\r\nДобавил пункт в menu.json","created_at":"2017-03-24T11:55:24Z","updated_at":"2017-03-24T14:26:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"77d0032e659584432e49122c276550338b998b46","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/phplego/kotlin.su/pulls/25/commits","review_comments_url":"https://api.github.com/repos/phplego/kotlin.su/pulls/25/comments","review_comment_url":"https://api.github.com/repos/phplego/kotlin.su/pulls/comments{/number}","comments_url":"https://api.github.com/repos/phplego/kotlin.su/issues/25/comments","statuses_url":"https://api.github.com/repos/phplego/kotlin.su/statuses/9ca19423b96e1df801426fbe8455d50fc86b91ed","head":{"label":"chipnesh:master","ref":"master","sha":"9ca19423b96e1df801426fbe8455d50fc86b91ed","user":{"login":"chipnesh","id":17617519,"avatar_url":"https://avatars1.githubusercontent.com/u/17617519?v=3","gravatar_id":"","url":"https://api.github.com/users/chipnesh","html_url":"https://github.com/chipnesh","followers_url":"https://api.github.com/users/chipnesh/followers","following_url":"https://api.github.com/users/chipnesh/following{/other_user}","gists_url":"https://api.github.com/users/chipnesh/gists{/gist_id}","starred_url":"https://api.github.com/users/chipnesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chipnesh/subscriptions","organizations_url":"https://api.github.com/users/chipnesh/orgs","repos_url":"https://api.github.com/users/chipnesh/repos","events_url":"https://api.github.com/users/chipnesh/events{/privacy}","received_events_url":"https://api.github.com/users/chipnesh/received_events","type":"User","site_admin":false},"repo":{"id":86062315,"name":"kotlin.su","full_name":"chipnesh/kotlin.su","owner":{"login":"chipnesh","id":17617519,"avatar_url":"https://avatars1.githubusercontent.com/u/17617519?v=3","gravatar_id":"","url":"https://api.github.com/users/chipnesh","html_url":"https://github.com/chipnesh","followers_url":"https://api.github.com/users/chipnesh/followers","following_url":"https://api.github.com/users/chipnesh/following{/other_user}","gists_url":"https://api.github.com/users/chipnesh/gists{/gist_id}","starred_url":"https://api.github.com/users/chipnesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chipnesh/subscriptions","organizations_url":"https://api.github.com/users/chipnesh/orgs","repos_url":"https://api.github.com/users/chipnesh/repos","events_url":"https://api.github.com/users/chipnesh/events{/privacy}","received_events_url":"https://api.github.com/users/chipnesh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chipnesh/kotlin.su","description":"Документация Kotlin на русском","fork":true,"url":"https://api.github.com/repos/chipnesh/kotlin.su","forks_url":"https://api.github.com/repos/chipnesh/kotlin.su/forks","keys_url":"https://api.github.com/repos/chipnesh/kotlin.su/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chipnesh/kotlin.su/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chipnesh/kotlin.su/teams","hooks_url":"https://api.github.com/repos/chipnesh/kotlin.su/hooks","issue_events_url":"https://api.github.com/repos/chipnesh/kotlin.su/issues/events{/number}","events_url":"https://api.github.com/repos/chipnesh/kotlin.su/events","assignees_url":"https://api.github.com/repos/chipnesh/kotlin.su/assignees{/user}","branches_url":"https://api.github.com/repos/chipnesh/kotlin.su/branches{/branch}","tags_url":"https://api.github.com/repos/chipnesh/kotlin.su/tags","blobs_url":"https://api.github.com/repos/chipnesh/kotlin.su/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chipnesh/kotlin.su/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chipnesh/kotlin.su/git/refs{/sha}","trees_url":"https://api.github.com/repos/chipnesh/kotlin.su/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chipnesh/kotlin.su/statuses/{sha}","languages_url":"https://api.github.com/repos/chipnesh/kotlin.su/languages","stargazers_url":"https://api.github.com/repos/chipnesh/kotlin.su/stargazers","contributors_url":"https://api.github.com/repos/chipnesh/kotlin.su/contributors","subscribers_url":"https://api.github.com/repos/chipnesh/kotlin.su/subscribers","subscription_url":"https://api.github.com/repos/chipnesh/kotlin.su/subscription","commits_url":"https://api.github.com/repos/chipnesh/kotlin.su/commits{/sha}","git_commits_url":"https://api.github.com/repos/chipnesh/kotlin.su/git/commits{/sha}","comments_url":"https://api.github.com/repos/chipnesh/kotlin.su/comments{/number}","issue_comment_url":"https://api.github.com/repos/chipnesh/kotlin.su/issues/comments{/number}","contents_url":"https://api.github.com/repos/chipnesh/kotlin.su/contents/{+path}","compare_url":"https://api.github.com/repos/chipnesh/kotlin.su/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chipnesh/kotlin.su/merges","archive_url":"https://api.github.com/repos/chipnesh/kotlin.su/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chipnesh/kotlin.su/downloads","issues_url":"https://api.github.com/repos/chipnesh/kotlin.su/issues{/number}","pulls_url":"https://api.github.com/repos/chipnesh/kotlin.su/pulls{/number}","milestones_url":"https://api.github.com/repos/chipnesh/kotlin.su/milestones{/number}","notifications_url":"https://api.github.com/repos/chipnesh/kotlin.su/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chipnesh/kotlin.su/labels{/name}","releases_url":"https://api.github.com/repos/chipnesh/kotlin.su/releases{/id}","deployments_url":"https://api.github.com/repos/chipnesh/kotlin.su/deployments","created_at":"2017-03-24T11:45:06Z","updated_at":"2017-03-13T08:47:33Z","pushed_at":"2017-03-24T11:53:39Z","git_url":"git://github.com/chipnesh/kotlin.su.git","ssh_url":"git@github.com:chipnesh/kotlin.su.git","clone_url":"https://github.com/chipnesh/kotlin.su.git","svn_url":"https://github.com/chipnesh/kotlin.su","homepage":"https://kotlinlang.ru","size":381,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"phplego:master","ref":"master","sha":"6bba2fed55e45827bee142db2a009f64ce7ca427","user":{"login":"phplego","id":3162688,"avatar_url":"https://avatars2.githubusercontent.com/u/3162688?v=3","gravatar_id":"","url":"https://api.github.com/users/phplego","html_url":"https://github.com/phplego","followers_url":"https://api.github.com/users/phplego/followers","following_url":"https://api.github.com/users/phplego/following{/other_user}","gists_url":"https://api.github.com/users/phplego/gists{/gist_id}","starred_url":"https://api.github.com/users/phplego/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phplego/subscriptions","organizations_url":"https://api.github.com/users/phplego/orgs","repos_url":"https://api.github.com/users/phplego/repos","events_url":"https://api.github.com/users/phplego/events{/privacy}","received_events_url":"https://api.github.com/users/phplego/received_events","type":"User","site_admin":false},"repo":{"id":47593755,"name":"kotlin.su","full_name":"phplego/kotlin.su","owner":{"login":"phplego","id":3162688,"avatar_url":"https://avatars2.githubusercontent.com/u/3162688?v=3","gravatar_id":"","url":"https://api.github.com/users/phplego","html_url":"https://github.com/phplego","followers_url":"https://api.github.com/users/phplego/followers","following_url":"https://api.github.com/users/phplego/following{/other_user}","gists_url":"https://api.github.com/users/phplego/gists{/gist_id}","starred_url":"https://api.github.com/users/phplego/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phplego/subscriptions","organizations_url":"https://api.github.com/users/phplego/orgs","repos_url":"https://api.github.com/users/phplego/repos","events_url":"https://api.github.com/users/phplego/events{/privacy}","received_events_url":"https://api.github.com/users/phplego/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/phplego/kotlin.su","description":"Документация Kotlin на русском","fork":false,"url":"https://api.github.com/repos/phplego/kotlin.su","forks_url":"https://api.github.com/repos/phplego/kotlin.su/forks","keys_url":"https://api.github.com/repos/phplego/kotlin.su/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phplego/kotlin.su/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phplego/kotlin.su/teams","hooks_url":"https://api.github.com/repos/phplego/kotlin.su/hooks","issue_events_url":"https://api.github.com/repos/phplego/kotlin.su/issues/events{/number}","events_url":"https://api.github.com/repos/phplego/kotlin.su/events","assignees_url":"https://api.github.com/repos/phplego/kotlin.su/assignees{/user}","branches_url":"https://api.github.com/repos/phplego/kotlin.su/branches{/branch}","tags_url":"https://api.github.com/repos/phplego/kotlin.su/tags","blobs_url":"https://api.github.com/repos/phplego/kotlin.su/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phplego/kotlin.su/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phplego/kotlin.su/git/refs{/sha}","trees_url":"https://api.github.com/repos/phplego/kotlin.su/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phplego/kotlin.su/statuses/{sha}","languages_url":"https://api.github.com/repos/phplego/kotlin.su/languages","stargazers_url":"https://api.github.com/repos/phplego/kotlin.su/stargazers","contributors_url":"https://api.github.com/repos/phplego/kotlin.su/contributors","subscribers_url":"https://api.github.com/repos/phplego/kotlin.su/subscribers","subscription_url":"https://api.github.com/repos/phplego/kotlin.su/subscription","commits_url":"https://api.github.com/repos/phplego/kotlin.su/commits{/sha}","git_commits_url":"https://api.github.com/repos/phplego/kotlin.su/git/commits{/sha}","comments_url":"https://api.github.com/repos/phplego/kotlin.su/comments{/number}","issue_comment_url":"https://api.github.com/repos/phplego/kotlin.su/issues/comments{/number}","contents_url":"https://api.github.com/repos/phplego/kotlin.su/contents/{+path}","compare_url":"https://api.github.com/repos/phplego/kotlin.su/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phplego/kotlin.su/merges","archive_url":"https://api.github.com/repos/phplego/kotlin.su/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phplego/kotlin.su/downloads","issues_url":"https://api.github.com/repos/phplego/kotlin.su/issues{/number}","pulls_url":"https://api.github.com/repos/phplego/kotlin.su/pulls{/number}","milestones_url":"https://api.github.com/repos/phplego/kotlin.su/milestones{/number}","notifications_url":"https://api.github.com/repos/phplego/kotlin.su/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phplego/kotlin.su/labels{/name}","releases_url":"https://api.github.com/repos/phplego/kotlin.su/releases{/id}","deployments_url":"https://api.github.com/repos/phplego/kotlin.su/deployments","created_at":"2015-12-08T02:37:51Z","updated_at":"2017-03-13T08:47:33Z","pushed_at":"2017-03-24T13:15:59Z","git_url":"git://github.com/phplego/kotlin.su.git","ssh_url":"git@github.com:phplego/kotlin.su.git","clone_url":"https://github.com/phplego/kotlin.su.git","svn_url":"https://github.com/phplego/kotlin.su","homepage":"https://kotlinlang.ru","size":375,"stargazers_count":14,"watchers_count":14,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":1,"forks":9,"open_issues":1,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/phplego/kotlin.su/pulls/25"},"html":{"href":"https://github.com/phplego/kotlin.su/pull/25"},"issue":{"href":"https://api.github.com/repos/phplego/kotlin.su/issues/25"},"comments":{"href":"https://api.github.com/repos/phplego/kotlin.su/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/phplego/kotlin.su/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/phplego/kotlin.su/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/phplego/kotlin.su/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/phplego/kotlin.su/statuses/9ca19423b96e1df801426fbe8455d50fc86b91ed"}}}}
{"actor":{"display_login":"phplego"}}