Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Contracts] Add Cache contract to extend PSR-6 with tag invalidation, callback-based computation and stampede protection#28096
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
b5b7e79 to9c19606Comparenicolas-grekas commentedAug 8, 2018
Now with a |
nicolas-grekas commentedAug 8, 2018
Also with |
| use Psr\Cache\CacheItemPoolInterface; | ||
| /** | ||
| * An interface that extends TawAwareCacheInterface with the methods from PSR-6's CacheItemPoolInterface. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
There's a typo:Taw =>Tag, also present in the PR description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
fixed thanks
9c19606 to19904f9Compare| * | ||
| * When implemented on a PSR-6 pool, invalidation should not apply | ||
| * to deferred items. Instead, they should be committed as usual. | ||
| * This allows replacing old tagged values by news ones without |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
new ones
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
fixed, thanks
19904f9 toa6659dbComparea6659db to0868ff4Compare
Nyholm left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Great.
I had a discussion with@nicolas-grekas.
Approved with changes
| /** | ||
| * An interface that extends TagAwareCacheInterface with the methods from PSR-6's CacheItemPoolInterface. | ||
| */ | ||
| interface ExtendedTagAwareCacheInterface extends TagAwareCacheInterface, CacheItemPoolInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
As discussed: Remove this.
| /** | ||
| * An interface that extends CacheInterface with the methods from PSR-6's CacheItemPoolInterface. | ||
| */ | ||
| interface ExtendedCacheInterface extends CacheInterface, CacheItemPoolInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We should remove this.
0868ff4 to805b719Comparenicolas-grekas commentedAug 30, 2018
Thanks@Nyholm , PR updated. |
Nyholm commentedAug 30, 2018
Thank you. Im 👍 |
09b706b tof7cad20Comparenicolas-grekas commentedSep 4, 2018
(rebased) |
f7cad20 to74506c4Comparenicolas-grekas commentedSep 4, 2018
Addressed, thanks. |
74506c4 tofe5d5c9Compare… callback-based computation and stampede protection
fe5d5c9 toca6478bCompare| interface CacheInterface | ||
| { | ||
| /** | ||
| * @param callable(ItemInterface):mixed $callback Should return the computed value for the given key/item |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
that's the declaration for the return type of the callable
| interface CacheInterface | ||
| { | ||
| /** | ||
| * @param callable(ItemInterface):mixed $callback Should return the computed value for the given key/item |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
that's the declaration for the return type of the callable
fabpot commentedSep 4, 2018
Thank you@nicolas-grekas. |
…g invalidation, callback-based computation and stampede protection (nicolas-grekas)This PR was merged into the 4.2-dev branch.Discussion----------[Contracts] Add Cache contract to extend PSR-6 with tag invalidation, callback-based computation and stampede protection| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -Let's separate the useful interfaces of the Cache component in Contracts.This does not include `PruneableInterface`, `MarshallerInterface` nor `*AdapterInterface` because they are too specific to the component.But `CacheInterface`, `TawAwareCacheInterface` and `ItemInterface` form a nice consistent set of features on top of PSR-6.Updating the Cache component to use these interfaces will be done in a separate PR so that we can focus on the contract itself here.Commits-------ca6478b [Contracts] Add Cache contract to extend PSR-6 with tag invalidation, callback-based computation and stampede protection
This PR was merged into the 4.2-dev branch.Discussion----------[Cache] leverage Contracts\Cache| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -Implementing#28096Commits-------0a1220f [Cache] leverage Contracts\Cache
Uh oh!
There was an error while loading.Please reload this page.
Let's separate the useful interfaces of the Cache component in Contracts.
This does not include
PruneableInterface,MarshallerInterfacenor*AdapterInterfacebecause they are too specific to the component.But
CacheInterface,TawAwareCacheInterfaceandItemInterfaceform a nice consistent set of features on top of PSR-6.Updating the Cache component to use these interfaces will be done in a separate PR so that we can focus on the contract itself here.