Skip to content

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

Merged
merged 1 commit into from
Oct 4, 2020
Merged

Conversation

jderusse
Copy link
Member

@jderusse jderusse commented Oct 21, 2019

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

@jderusse
Copy link
Member Author

RFR

Copy link
Contributor

@clemherreman clemherreman left a 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

@jderusse jderusse force-pushed the lock-fw branch 5 times, most recently from 825534d to d8a8416 Compare April 18, 2020 10:47
Copy link
Contributor

@maxhelias maxhelias left a 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 😁

Copy link
Member

@wouterj wouterj left a 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.
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member Author

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 :)

Copy link
Member Author

Choose a reason for hiding this comment

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

reworded

Copy link
Member

@wouterj wouterj Oct 4, 2020

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?

Copy link
Member Author

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

@wouterj wouterj changed the base branch from master to 4.4 October 4, 2020 11:00
@wouterj
Copy link
Member

wouterj commented Oct 4, 2020

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.

@wouterj wouterj merged commit 2900e50 into symfony:4.4 Oct 4, 2020
wouterj added a commit that referenced this pull request Oct 4, 2020
wouterj added a commit that referenced this pull request Oct 4, 2020
* 4.4:
  [#11009] Some tweaks
  [DependencyInjection] Doc for #30257 Allow to choose an index for tagged collection
  [#12523] Reworded caution
  Add a documentation page for lock in FW
  [Configuration] Add documentation about `ignore_errors: not_found` option.
wouterj added a commit that referenced this pull request Oct 4, 2020
* 5.1:
  [#11009] Some tweaks
  [DependencyInjection] Doc for #30257 Allow to choose an index for tagged collection
  [#12523] Reworded caution
  Add a documentation page for lock in FW
  [Configuration] Add documentation about `ignore_errors: not_found` option.
@xabbuh xabbuh added this to the 4.4 milestone Oct 5, 2020
@xabbuh xabbuh added the Lock label Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lock] Add missing lock connection string in FrameworkExtension
7 participants