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] add "setCallbackWrapper()" on adapters implementing CacheInterface for more flexibility#28588

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
fabpot merged 1 commit intosymfony:masterfromnicolas-grekas:cache-gettrait
Sep 26, 2018

Conversation

@nicolas-grekas
Copy link
Member

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

Preparing my talk at SymfonyLive London, see you all there :)

This allows wrapping the callback passed to->get($item, $callback, $beta) in a callable that should at least return$callback($item), but can do something around the call.
The default wrapper is locking the key to provide lock-based stampede protection.
That was already the case before this PR, but in a much dirtier way at the design level.
Fixes a few issues found meanwhile.

* An implementation for CacheInterface that provides stampede protection via probabilistic early expiration.
*
* @see https://en.wikipedia.org/wiki/Cache_stampede
*
Copy link
Member

Choose a reason for hiding this comment

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

I think we should move the comment where you moved the implementation.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

The comment is on the contracts interface now, that's why I removed it here.

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commit8cf3625 intosymfony:masterSep 26, 2018
fabpot added a commit that referenced this pull requestSep 26, 2018
…nting CacheInterface for more flexibility (nicolas-grekas)This PR was merged into the 4.2-dev branch.Discussion----------[Cache] add "setCallbackWrapper()" on adapters implementing CacheInterface for more flexibility| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | yes| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#27730| License       | MIT| Doc PR        | -Preparing my talk at SymfonyLive London, see you all there :)This allows wrapping the callback passed to `->get($item, $callback, $beta)` in a callable that should at least return `$callback($item)`, but can do something around the call.The default wrapper is locking the key to provide lock-based stampede protection.That was already the case before this PR, but in a much dirtier way at the design level.Fixes a few issues found meanwhile.Commits-------8cf3625 [Cache] add "setCallbackWrapper()" on adapters implementing CacheInterface for more flexibility
@nicolas-grekasnicolas-grekas deleted the cache-gettrait branchSeptember 26, 2018 07:21
@nicolas-grekasnicolas-grekas modified the milestones:next,4.2Nov 1, 2018
This was referencedNov 3, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.2

Development

Successfully merging this pull request may close these issues.

3 participants

@nicolas-grekas@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp