Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 1.1 KB

File metadata and controls

48 lines (36 loc) · 1.1 KB

Adapter

Create cache adapter.

Reference

  • Adapter Service Interface: CleverAge\CacheProcessBundle\Adapter\AdapterInterface

Options

Code Type Required Default Description
code string X Service identifier, used by Task adapter option
adapter string X Symfony\Component\Cache\Adapter\AdapterInterface service

Examples

<?php

declare(strict_types=1);

namespace App\Adapter;

use CleverAge\CacheProcessBundle\Adapter\Adapter;
use Symfony\Component\Cache\Adapter\ArrayAdapter;

class MemoryAdapter extends Adapter
{
    public function __construct()
    {
        $cache = new ArrayAdapter();
        parent::__construct($cache, 'memory');
    }
}
services:
  app.cleverage_cache_process.adapter.memory:
    class: App\Adapter\MemoryAdapter
    tags:
      - { name: cleverage.cache.adapter }