8000 [FrameworkBundle] Deprecate lock service by jderusse · Pull Request #38576 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] Deprecate lock service #38576

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 15, 2020

Conversation

jderusse
Copy link
Member
Q A
Branch? 5.x
Bug fix? no
New feature? no
Deprecations? yes
Tickets #38458
License MIT
Doc PR TODO

This PR deprecate the lock, LockInterface service ass discussed in #38458

@fabpot
Copy link
Member
fabpot commented Oct 15, 2020

Thank you @jderusse.

@fabpot fabpot merged commit 5bc26de into symfony:5.x Oct 15, 2020
@nicolas-grekas nicolas-grekas added this to the 5.2 milestone Oct 15, 2020
@jderusse jderusse changed the title Deeprecate lock service [FrameworkBundle] Deprecate lock service Oct 15, 2020
@jderusse jderusse deleted the deprecate-lock-service branch October 15, 2020 10:01
derrabus added a commit that referenced this pull request Oct 15, 2020
…ices (jderusse)

This PR was merged into the 5.x branch.

Discussion
----------

[FrameworkBundle] Missing Changelog for deprecating services

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | /
| License       | MIT
| Doc PR        | /

I forgot to add CHANGELOG/UPGRADE when deprecating alias `lock` in #38576. (thank you  @nicolas-grekas for reminding this)

This PR also adds a missing alias registered for argument.

Commits
-------

f9ddc5c Missing Changelog for deprecating services
fabpot added a commit that referenced this pull request Oct 16, 2020
…cate lock.store services (jderusse)

This PR was merged into the 5.x branch.

Discussion
----------

[Lock][Semaphore] Add Factory::createFromKey and deprecate lock.store services

I| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | /
| License       | MIT
| Doc PR        | todo

The `lock` service and aliases have been deprecated in #38576. This PR also deprecate the `lock.store` service and aliases.

People should always inject the factory into their services, except for one scenario: When they want building the `Lock` manually because they want to keep the key.

This scenario require declaring `lock.store` service and `PersisingStoreInterface` aliases.
This could be avoided if people had a method to create a lock from a given key.

This PR adds a `LockFactory::createFromKey()` method and deprecate all `lock.store` services

I also updated the Semaphore component for consistency, and helping people to only inject the SemahoreFactory.

nb: use cases for serializing the keys:
- Netflix allows only 5 users of the same family at the same time.
- An holiday apartment rental avoid users putting the same apartment in the basket
- ...

Commits
-------

91fa3e3 Deprecate lock.store aliases
@fabpot fabpot mentioned this pull request Oct 28, 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.

4 participants
0