Skip to content

[lock] Provides default implementation when store does not supports the behavior #38296

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
Sep 27, 2020

Conversation

jderusse
Copy link
Member

@jderusse jderusse commented Sep 24, 2020

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? yes
Tickets /
License MIT
Doc PR /

All stores does not provide the same behaviors. Some are blocking, some allows shared Locks, ...
Issue is: When people use lock to use a behavior that is not supported by the store, they get an UnsuportedException, but they don't have any way to know if the store supports or not the behavior they want to use.

ie: when using the FrameworkBundle

framework:
    lock: '%env(LOCK_DSN)%'

User (or bundle) can't use safely $lock->acquire(true) or $lock->acquireRead().

Given it's very easy to provide an fallback implementation to those behavior, this PR

  • use fallback implementation when store does not support the behavior
  • deprecate the RetryTillSaveStore (not needed anymore)

@jderusse jderusse changed the title Provides default implementation when store does not supports the beha… [lock] Provides default implementation when store does not supports the behavior Sep 24, 2020
@nicolas-grekas
Copy link
Member

Don't miss updating changelog+upgrade files.

@nicolas-grekas nicolas-grekas added this to the next milestone Sep 25, 2020
@fabpot
Copy link
Member

fabpot commented Sep 27, 2020

Thank you @jderusse.

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