File tree Expand file tree Collapse file tree 3 files changed +107
-0
lines changed Expand file tree Collapse file tree 3 files changed +107
-0
lines changed Original file line number Diff line number Diff line change 1+ clever_age_process :
2+ configurations :
3+ demo.cache.set_get :
4+ description : >
5+ A simple process which set and get cached values
6+ help : >
7+ Ex: bin/console cleverage:process:execute demo.cache.set_get
8+ options :
9+ ui :
10+ source : Bar
11+ target : Foo
12+ tasks :
13+ start :
14+ service : ' @CleverAge\ProcessBundle\Task\DummyTask'
15+ outputs : [ data, get, get_missing ]
16+
17+ data :
18+ service : ' @CleverAge\ProcessBundle\Task\ConstantIterableOutputTask'
19+ outputs : [ format ]
20+ options :
21+ output :
22+ - key : ' key1'
23+ column1 : value1-1
24+ column2 : value2-1
25+ column3 : value3-1
26+ - key : ' key2'
27+ column1 : value1-2
28+ column2 : value2-2
29+ column3 : value3-2
30+ - key : ' key3'
31+ column1 : ' '
32+ column2 : null
33+ column3 : value3-3
34+ format :
35+ service : ' @CleverAge\ProcessBundle\Task\TransformerTask'
36+ options :
37+ transformers :
38+ mapping :
39+ mapping :
40+ key :
41+ code : ' [key]'
42+ value :
43+ code : ' .'
44+ outputs : [ set ]
45+
46+ set :
47+ service : ' @CleverAge\CacheProcessBundle\Task\SetTask'
48+ options :
49+ adapter : ' memory'
50+ key : ' ' # overrided by input'
51+ value : ' ' # overrided by input
52+
53+ get :
54+ service : ' @CleverAge\CacheProcessBundle\Task\GetTask'
55+ options :
56+ adapter : ' memory'
57+ key : ' key2'
58+ outputs : [ debug ]
59+
60+ get_missing :
61+ service : ' @CleverAge\CacheProcessBundle\Task\GetTask'
62+ options :
63+ adapter : ' memory'
64+ key : ' missing'
65+ outputs : [ debug ]
66+
67+ debug :
68+ service : ' @CleverAge\ProcessBundle\Task\Debug\DebugTask'
Original file line number Diff line number Diff line change @@ -56,3 +56,9 @@ services:
5656 $uri : ' https://apicarto.ign.fr/api'
5757 tags :
5858 - { name: cleverage.rest.client }
59+
60+ # For cleverage/cache-process-bundle
61+ app.cleverage_cache_process.adapter.memory :
62+ class : App\Adapter\MemoryAdapter
63+ tags :
64+ - { name: cleverage.cache.adapter }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace App \Adapter ;
6+
7+ use CleverAge \CacheProcessBundle \Adapter \Adapter ;
8+ use Symfony \Component \Cache \Adapter \ArrayAdapter ;
9+
10+ class MemoryAdapter extends Adapter
11+ {
12+ public function __construct ()
13+ {
14+ $ cache = new ArrayAdapter (
15+ // the default lifetime (in seconds) for cache items that do not define their
16+ // own lifetime, with a value 0 causing items to be stored indefinitely (i.e.
17+ // until the current PHP process finishes)
18+ $ defaultLifetime = 0 ,
19+
20+ // if true, the values saved in the cache are serialized before storing them
21+ $ storeSerialized = true ,
22+
23+ // the maximum lifetime (in seconds) of the entire cache (after this time, the
24+ // entire cache is deleted to avoid stale data from consuming memory)
25+ $ maxLifetime = 0 ,
26+
27+ // the maximum number of items that can be stored in the cache. When the limit
28+ // is reached, cache follows the LRU model (least recently used items are deleted)
29+ $ maxItems = 0
30+ );
31+ parent ::__construct ($ cache , 'memory ' );
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments