Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Cache] allow to skip saving the computed value when using CacheInterface::get()#29022

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedOct 30, 2018
edited
Loading

QA
Branch?4.2
Bug fix?yes
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

While trying to play with using Messenger and Cache together, I spotted a few issues related to the newCacheInterface::get() method:

  • there must be a way to skip saving the computed value in the pool. This is needed in my (still local WIP) use case - and is also needed forLockRegistry: processes that wait for the lock to be released should not write the value back when the lock is over. This is addressed by adding a 2ndbool &$save argument to the computing callback. When the callback sets this reference to true, the returned value should not be written to the pool.
  • in order to better document the signature of this callback, a newCallbackInterface is added in theContracts\Cache namespace. This will help autocompletion and implementations.
  • ContractsTrait was writing twice the value to the pool - now fixed
  • LockRegistry did not retry locking when a waiting process wasn't able to fetch the fresh value - now fixed.

@nicolas-grekasnicolas-grekas merged commit321d7f4 intosymfony:masterOct 31, 2018
nicolas-grekas added a commit that referenced this pull requestOct 31, 2018
…sing CacheInterface::get() (nicolas-grekas)This PR was merged into the 4.2-dev branch.Discussion----------[Cache] allow to skip saving the computed value when using CacheInterface::get()| Q             | A| ------------- | ---| Branch?       | 4.2| Bug fix?      | yes| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -While trying to play with using Messenger and Cache together, I spotted a few issues related to the new `CacheInterface::get()` method:- there must be a way to skip saving the computed value in the pool. This is needed in my (still local WIP) use case - and is also needed for `LockRegistry`: processes that wait for the lock to be released should not write the value back when the lock is over. This is addressed by adding a 2nd `bool &$save` argument to the computing callback. When the callback sets this reference to true, the returned value should not be written to the pool.- in order to better document the signature of this callback, a new `CallbackInterface` is added in the `Contracts\Cache` namespace. This will help autocompletion and implementations.- `ContractsTrait` was writing twice the value to the pool - now fixed- `LockRegistry` did not retry locking when a waiting process wasn't able to fetch the fresh value - now fixed.Commits-------321d7f4 [Cache] allow to skip saving the computed value when using CacheInterface::get()
@nicolas-grekasnicolas-grekas deleted the cache-do-save branchOctober 31, 2018 08:49
This was referencedNov 3, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

4.2

Development

Successfully merging this pull request may close these issues.

2 participants

@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp