Skip to content
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

Add CachingConverter #35

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Add CachingConverter #35

wants to merge 9 commits into from

Conversation

jdreesen
Copy link
Member

@jdreesen jdreesen commented Jan 28, 2023

This re-adds the CachingConverter with an overhauled implementation which respects the context.

Todo:

  • adapt the docs

@jdreesen jdreesen force-pushed the refactor-cache-management branch 2 times, most recently from 9c1b46a to 1c7c44a Compare January 28, 2023 16:28
@jdreesen jdreesen marked this pull request as draft January 28, 2023 17:44
@jdreesen jdreesen mentioned this pull request Jan 28, 2023
@jdreesen jdreesen force-pushed the refactor-cache-management branch 3 times, most recently from 51e3c1a to f1dad54 Compare January 31, 2023 22:40
- strip the "management" part from the name(space)
- move it into the "Converter" namespace
- refine class/method names
@jdreesen jdreesen force-pushed the refactor-cache-management branch from b0cd2df to 70601a4 Compare January 31, 2023 23:27
@jdreesen jdreesen changed the title Refactor cache management Add CachingConverter Jan 31, 2023
@mike4git
Copy link
Collaborator

mike4git commented Feb 4, 2023

Have you every thought about using the Symfony contracts for Caching:
https://github.com/symfony/contracts/blob/main/Cache/CacheInterface.php

AFAIK, the callback would be our Converter call and the key has been already provided.
I think for the first version we could skip beta and metadata but last but not least we are able to use an integrate any Caching mechanism...InMemory, File based, Redis cache

Copy link
Collaborator

@mike4git mike4git left a comment

Choose a reason for hiding this comment

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

Just some improvements for my old eyes ;-)

src/Converter/Cache/CacheKeyFactory.php Outdated Show resolved Hide resolved
src/Converter/Cache/InMemoryCache.php Outdated Show resolved Hide resolved
src/Converter/Cache/InMemoryCache.php Outdated Show resolved Hide resolved
tests/Fixtures/Converter/Cache/UserKeyFactory.php Outdated Show resolved Hide resolved
@jdreesen
Copy link
Member Author

jdreesen commented Feb 5, 2023

Have you every thought about using the Symfony contracts for Caching: symfony/contracts@main/Cache/CacheInterface.php
[...] we are able to use an integrate any Caching mechanism...InMemory, File based, Redis cache

Yes, I thought about it, but I'm not sure if it's the best contract to depend upon. There are also PSR-6 and PSR-16 and I currently tend towards the latter. Symfony supports all three, so we are free to choose what suits us best.

@jdreesen
Copy link
Member Author

jdreesen commented Feb 6, 2023

This is currently on hold until #41 is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants