8000 Add docs for the Lock component by jderusse · Pull Request #7364 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Add docs for the Lock component #7364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 24, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename quorum strategy
  • Loading branch information
jderusse committed Feb 17, 2017
commit d6a218c8ace40b0f4d02d0d56ed5cfd4fc502bba
8 changes: 4 additions & 4 deletions components/lock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ is being acquired, it forwards the call to all the managed stores, and it
collects their responses. If a simple majority of stores have acquired the lock,
then the lock is considered as acquired; otherwise is not acquired::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise as not acquired?


use Symfony\Component\Lock\Quorum\MajorityQuorum;
use Symfony\Component\Lock\Quorum\ConsensusStrategy;
use Symfony\Component\Lock\Store\CombinedStore;
use Symfony\Component\Lock\Store\RedisStore;

Expand All @@ -247,10 +247,10 @@ then the lock is considered as acquired; otherwise is not acquired::
$stores[] = new RedisStore($redis);
}

$store = new CombinedStore($stores, new MajorityQuorum());
$store = new CombinedStore($stores, new ConsensusStrategy());

Instead of the simple majority strategy (``MajorityQuorum``) you can use the
``UnanimousQuorum`` to require the lock to be acquired in all the stores.
Instead of the simple majority strategy (``ConsensusStrategy``) you can use the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"you can use the UnanimousStrategy to require the lock" => "an UnanimousStrategy can be used to require the lock"

``UnanimousStrategy`` to require the lock to be acquired in all the stores.

.. _`locks`: https://en.wikipedia.org/wiki/Lock_(computer_science)
.. _Packagist: https://packagist.org/packages/symfony/lock
Expand Down
0