Code Monkey home page Code Monkey logo

annotated-cache's People

Contributors

veewee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

annotated-cache's Issues

Add new SymfonyCacheableInterceptor that interacts with Symfony pool manager

Phpro\AnnotatedCache\Interceptor\CacheableInterceptor::interceptSuffix returns Cache\Adapter\Common\CacheItem;

but Symfony\Component\Cache\Adapter interacts only with Symfony\Component\Cache\CacheItem otherwise will skip save to cache

@see Symfony\Component\Cache\Adapter\AbstractAdapter::save()

    public function save(CacheItemInterface $item)
    {
        if (!$item instanceof CacheItem) {
            return false;
        }
        $this->deferred[$item->getKey()] = $item;

        return $this->commit();
    }

Or there should be fix on Symfony side in this method?

Edit: Symfony is logging some debug info via static method CacheItem::log, thats missing in standardized Cache\Adapter\Common\CacheItem;

Edit2: I have created new SymfonyInterceptor
https://github.com/insekticid/phpro-annotated-cache-symfony-cache

Cache-Namespaces?

Hi there,

Nice looking library. I want to give it try. But I'm new to all the PSR-6 cache handling. So maybe I just didnt understand something about that yet...

Lets say I have a service with 2 methods, each method is a getSomething($key), so I annotate them like this:

/**
 * @Cacheable(pools="products")
 */
public function hasProduct($productCode)
{
...
}

/**
 * @Cacheable(pools="products")
 */
public function getProductName($productCode)
{
....
}

I want to have all arguments as the key, so I omit the key="" attribute. Why is it that even if I use different pools for both methods that I end up having only one key written in my cache backend (which is redis). I thought that the method's name is taken into account when generating the key, or at least the pool's name...

I'm stuck :(

Your code looks awesome and its definitely a better implementation than the one from https://github.com/TheBigBrainsCompany/TbbcCacheBundle (which is also good)

Thanks for any hint
Markus

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.