{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments/103333693","pull_request_review_id":24117008,"id":103333693,"diff_hunk":"@@ -0,0 +1,257 @@\n+.. index::\n+   single: Lock\n+   single: Components; Lock\n+\n+The Lock Component\n+==================\n+\n+    The Lock Component creates and manages `locks`_, a mechanism to provide\n+    exclusive access to a shared resource.\n+\n+.. versionadded:: 3.3\n+    The Lock component was introduced in Symfony 3.3.\n+\n+Installation\n+------------\n+\n+You can install the component in 2 different ways:\n+\n+* :doc:`Install it via Composer </components/using_components>` (``symfony/lock`` on `Packagist`_);\n+* Use the official Git repository (https://github.com/symfony/lock).\n+\n+.. include:: /components/require_autoload.rst.inc\n+\n+Usage\n+-----\n+\n+Locks are used to guarantee exclusive access to some shared resource. In\n+Symfony applications, you can use locks for example to ensure that a command is\n+not executed more than once at the same time (on the same or different servers).\n+\n+In order to manage the state of locks, you first need to create a ``Store``\n+and then use the :class:`Symfony\\\\Component\\\\Lock\\\\Factory` class to actually\n+create the lock for some resource::\n+\n+    use Symfony\\Component\\Lock\\Factory;\n+    use Symfony\\Component\\Lock\\Store\\SemaphoreStore;\n+\n+    $store = new SemaphoreStore();\n+    $factory = new Factory($store);\n+\n+Then, call to the :method:`Symfony\\\\Component\\\\Lock\\\\LockInterface::acquire`\n+method to try to acquire the lock. Its first argument is an arbitrary string\n+that represents the locked resource::\n+\n+    // ...\n+    $lock = $factory->createLock('pdf-invoice-generation');\n+\n+    if ($lock->acquire()) {\n+        // The resource \"pdf-invoice-generation\" is locked.\n+        // You can compute and generate invoice safely here.\n+\n+        $lock->release();\n+    }\n+\n+If the lock can not be acquired, the method returns ``false``. You can safely\n+call the ``acquire()`` method repeatedly, even if you already acquired it.\n+\n+.. note::\n+\n+    Unlike other implementations, the Lock Component distinguishes locks\n+    instances even when they are created for the same resource. If you want to\n+    share a lock in several services, share the ``Lock`` instance returned by\n+    the ``Factory::createLock`` method.\n+\n+Blocking Locks\n+--------------\n+\n+By default, when a lock cannot be acquired, the ``acquire`` method returns\n+``false`` immediately. In case you want to wait (indefinitely) until the lock\n+can be created, pass ``false`` as the argument of the ``acquire()`` method. This","path":"components/lock.rst","position":70,"original_position":70,"commit_id":"d6a218c8ace40b0f4d02d0d56ed5cfd4fc502bba","original_commit_id":"d6a218c8ace40b0f4d02d0d56ed5cfd4fc502bba","user":{"login":"HeahDude","id":10107633,"avatar_url":"https://avatars.githubusercontent.com/u/10107633?v=3","gravatar_id":"","url":"https://api.github.com/users/HeahDude","html_url":"https://github.com/HeahDude","followers_url":"https://api.github.com/users/HeahDude/followers","following_url":"https://api.github.com/users/HeahDude/following{/other_user}","gists_url":"https://api.github.com/users/HeahDude/gists{/gist_id}","starred_url":"https://api.github.com/users/HeahDude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeahDude/subscriptions","organizations_url":"https://api.github.com/users/HeahDude/orgs","repos_url":"https://api.github.com/users/HeahDude/repos","events_url":"https://api.github.com/users/HeahDude/events{/privacy}","received_events_url":"https://api.github.com/users/HeahDude/received_events","type":"User","site_admin":false},"body":"This one is not so minor I guess","created_at":"2017-02-27T22:51:26Z","updated_at":"2017-02-27T22:51:26Z","html_url":"https://github.com/symfony/symfony-docs/pull/7364#discussion_r103333693","pull_request_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/7364","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments/103333693"},"html":{"href":"https://github.com/symfony/symfony-docs/pull/7364#discussion_r103333693"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/7364"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony-docs/pulls/7364","id":101575265,"html_url":"https://github.com/symfony/symfony-docs/pull/7364","diff_url":"https://github.com/symfony/symfony-docs/pull/7364.diff","patch_url":"https://github.com/symfony/symfony-docs/pull/7364.patch","issue_url":"https://api.github.com/repos/symfony/symfony-docs/issues/7364","number":7364,"state":"open","locked":false,"title":"[WCM] Add docs for the Lock component ","user":{"login":"jderusse","id":578547,"avatar_url":"https://avatars.githubusercontent.com/u/578547?v=3","gravatar_id":"","url":"https://api.github.com/users/jderusse","html_url":"https://github.com/jderusse","followers_url":"https://api.github.com/users/jderusse/followers","following_url":"https://api.github.com/users/jderusse/following{/other_user}","gists_url":"https://api.github.com/users/jderusse/gists{/gist_id}","starred_url":"https://api.github.com/users/jderusse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jderusse/subscriptions","organizations_url":"https://api.github.com/users/jderusse/orgs","repos_url":"https://api.github.com/users/jderusse/repos","events_url":"https://api.github.com/users/jderusse/events{/privacy}","received_events_url":"https://api.github.com/users/jderusse/received_events","type":"User","site_admin":false},"body":"See symfony/symfony#21093","created_at":"2017-01-14T21:24:40Z","updated_at":"2017-02-27T22:51:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a7ff3852b5ecc66aabcb6bde8c96e19395481845","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/7364/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/7364/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony-docs/issues/7364/comments","statuses_url":"https://api.github.com/repos/symfony/symfony-docs/statuses/d6a218c8ace40b0f4d02d0d56ed5cfd4fc502bba","head":{"label":"jderusse:lock-component","ref":"lock-component","sha":"d6a218c8ace40b0f4d02d0d56ed5cfd4fc502bba","user":{"login":"jderusse","id":578547,"avatar_url":"https://avatars.githubusercontent.com/u/578547?v=3","gravatar_id":"","url":"https://api.github.com/users/jderusse","html_url":"https://github.com/jderusse","followers_url":"https://api.github.com/users/jderusse/followers","following_url":"https://api.github.com/users/jderusse/following{/other_user}","gists_url":"https://api.github.com/users/jderusse/gists{/gist_id}","starred_url":"https://api.github.com/users/jderusse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jderusse/subscriptions","organizations_url":"https://api.github.com/users/jderusse/orgs","repos_url":"https://api.github.com/users/jderusse/repos","events_url":"https://api.github.com/users/jderusse/events{/privacy}","received_events_url":"https://api.github.com/users/jderusse/received_events","type":"User","site_admin":false},"repo":{"id":19909694,"name":"symfony-docs","full_name":"jderusse/symfony-docs","owner":{"login":"jderusse","id":578547,"avatar_url":"https://avatars.githubusercontent.com/u/578547?v=3","gravatar_id":"","url":"https://api.github.com/users/jderusse","html_url":"https://github.com/jderusse","followers_url":"https://api.github.com/users/jderusse/followers","following_url":"https://api.github.com/users/jderusse/following{/other_user}","gists_url":"https://api.github.com/users/jderusse/gists{/gist_id}","starred_url":"https://api.github.com/users/jderusse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jderusse/subscriptions","organizations_url":"https://api.github.com/users/jderusse/orgs","repos_url":"https://api.github.com/users/jderusse/repos","events_url":"https://api.github.com/users/jderusse/events{/privacy}","received_events_url":"https://api.github.com/users/jderusse/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jderusse/symfony-docs","description":"The Symfony2 documentation","fork":true,"url":"https://api.github.com/repos/jderusse/symfony-docs","forks_url":"https://api.github.com/repos/jderusse/symfony-docs/forks","keys_url":"https://api.github.com/repos/jderusse/symfony-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jderusse/symfony-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jderusse/symfony-docs/teams","hooks_url":"https://api.github.com/repos/jderusse/symfony-docs/hooks","issue_events_url":"https://api.github.com/repos/jderusse/symfony-docs/issues/events{/number}","events_url":"https://api.github.com/repos/jderusse/symfony-docs/events","assignees_url":"https://api.github.com/repos/jderusse/symfony-docs/assignees{/user}","branches_url":"https://api.github.com/repos/jderusse/symfony-docs/branches{/branch}","tags_url":"https://api.github.com/repos/jderusse/symfony-docs/tags","blobs_url":"https://api.github.com/repos/jderusse/symfony-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jderusse/symfony-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jderusse/symfony-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/jderusse/symfony-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jderusse/symfony-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/jderusse/symfony-docs/languages","stargazers_url":"https://api.github.com/repos/jderusse/symfony-docs/stargazers","contributors_url":"https://api.github.com/repos/jderusse/symfony-docs/contributors","subscribers_url":"https://api.github.com/repos/jderusse/symfony-docs/subscribers","subscription_url":"https://api.github.com/repos/jderusse/symfony-docs/subscription","commits_url":"https://api.github.com/repos/jderusse/symfony-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/jderusse/symfony-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/jderusse/symfony-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/jderusse/symfony-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/jderusse/symfony-docs/contents/{+path}","compare_url":"https://api.github.com/repos/jderusse/symfony-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jderusse/symfony-docs/merges","archive_url":"https://api.github.com/repos/jderusse/symfony-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jderusse/symfony-docs/downloads","issues_url":"https://api.github.com/repos/jderusse/symfony-docs/issues{/number}","pulls_url":"https://api.github.com/repos/jderusse/symfony-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/jderusse/symfony-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/jderusse/symfony-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jderusse/symfony-docs/labels{/name}","releases_url":"https://api.github.com/repos/jderusse/symfony-docs/releases{/id}","deployments_url":"https://api.github.com/repos/jderusse/symfony-docs/deployments","created_at":"2014-05-18T12:09:56Z","updated_at":"2017-01-14T14:21:48Z","pushed_at":"2017-02-17T16:12:13Z","git_url":"git://github.com/jderusse/symfony-docs.git","ssh_url":"git@github.com:jderusse/symfony-docs.git","clone_url":"https://github.com/jderusse/symfony-docs.git","svn_url":"https://github.com/jderusse/symfony-docs","homepage":"http://symfony.com/doc/current/","size":39864,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"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":"symfony:master","ref":"master","sha":"f2a40f74ca511c264b9026ac463c0be2755c675b","user":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":521583,"name":"symfony-docs","full_name":"symfony/symfony-docs","owner":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/symfony/symfony-docs","description":"The Symfony documentation","fork":false,"url":"https://api.github.com/repos/symfony/symfony-docs","forks_url":"https://api.github.com/repos/symfony/symfony-docs/forks","keys_url":"https://api.github.com/repos/symfony/symfony-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony-docs/teams","hooks_url":"https://api.github.com/repos/symfony/symfony-docs/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony-docs/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony-docs/events","assignees_url":"https://api.github.com/repos/symfony/symfony-docs/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony-docs/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony-docs/tags","blobs_url":"https://api.github.com/repos/symfony/symfony-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony-docs/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony-docs/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony-docs/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony-docs/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony-docs/subscription","commits_url":"https://api.github.com/repos/symfony/symfony-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/symfony-docs/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony-docs/merges","archive_url":"https://api.github.com/repos/symfony/symfony-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony-docs/downloads","issues_url":"https://api.github.com/repos/symfony/symfony-docs/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony-docs/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony-docs/releases{/id}","deployments_url":"https://api.github.com/repos/symfony/symfony-docs/deployments","created_at":"2010-02-17T08:43:51Z","updated_at":"2017-02-23T03:56:25Z","pushed_at":"2017-02-27T21:35:13Z","git_url":"git://github.com/symfony/symfony-docs.git","ssh_url":"git@github.com:symfony/symfony-docs.git","clone_url":"https://github.com/symfony/symfony-docs.git","svn_url":"https://github.com/symfony/symfony-docs","homepage":"http://symfony.com/doc","size":41031,"stargazers_count":1210,"watchers_count":1210,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2805,"mirror_url":null,"open_issues_count":456,"forks":2805,"open_issues":456,"watchers":1210,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/7364"},"html":{"href":"https://github.com/symfony/symfony-docs/pull/7364"},"issue":{"href":"https://api.github.com/repos/symfony/symfony-docs/issues/7364"},"comments":{"href":"https://api.github.com/repos/symfony/symfony-docs/issues/7364/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/7364/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/7364/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony-docs/statuses/d6a218c8ace40b0f4d02d0d56ed5cfd4fc502bba"}}}}
{"actor":{"display_login":"HeahDude"}}