-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add a documentation page for lock in FW #12523
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
Conversation
RFR |
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.
If I were a real reviewer, I'd say this looks good to merge :) Thank you @jderusse
825534d
to
d8a8416
Compare
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.
Thanks for the reminder, i forgot some notion 😁
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.
Sorry for completely missing this PR @jderusse! I think it's a very great step (we're trying to move all important information from the component to the main guides in the docs).
I've left a few comments, most of them are minor and can be fixed while merging. So don't worry if you don't have time to fix them now :) Imho, it's ready for merge
lock.rst
Outdated
|
||
The same instance of ``LockInterface`` won't block when calling `acquire`` | ||
multiple times. If several services share the same ``lock`` service, they | ||
won't lock each other, use ``LockFactory`` instead. |
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.
I don't really understand this caution. The above example, when run concurrently will block eachother, right?
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.
Depends, what you call concurrently
, when running currently in the same process (think react-php), the same instance of Lock (think shared service) wont block.
Bellow case where lock does not apply
$lock = new Lock();
$lock->acquire();
$lock->acquire(); // no lock (same instance)
$lock = new Lock();
$a = new ReactControler($lock);
$b = new ReactControler($lock); // Both $a and share same lock instance and wont block each other
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.
I would appreciate help to rephrase my sentence :)
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.
reworded
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.
Thanks for clarifying! I've revisited this caution in 1170a7c . Can you please check if the new contents of this caution are correct?
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.
sounds good.
Thanks for your help
Thanks a lot Jérémy! This PR has been forgotten about for to many times, my apologies. It's now merged into the 4.4 version of the docs. |
This PR add a dedicated page to explain how to use Lock with FrameworkBundle
This PR slightly depends on symfony/symfony#34043 (PDO and Zookeeper DSN)
I should have pushed this PR years ago 😢 sorry about that...
Fixes: #12561