-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6469016
Add the Lock Component
jderusse 60bfe03
Fix typo
jderusse d1d3b71
Fixed minor typos and syntax issues
javiereguiluz 2498ccd
Fix typo
jderusse 6b6d865
Final review and some minor rewords/simplifications
javiereguiluz 17248e1
Remove codeblock
jderusse d6a218c
Rename quorum strategy
jderusse d4326c0
Reduce usage of "you"
jderusse 3035fe9
Rename quorum into strategy
jderusse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Rename quorum strategy
- Loading branch information
commit d6a218c8ace40b0f4d02d0d56ed5cfd4fc502bba
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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:: | ||
|
||
use Symfony\Component\Lock\Quorum\MajorityQuorum; | ||
use Symfony\Component\Lock\Quorum\ConsensusStrategy; | ||
use Symfony\Component\Lock\Store\CombinedStore; | ||
use Symfony\Component\Lock\Store\RedisStore; | ||
|
||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "you can use the |
||
``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 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise as not acquired?