Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions config/packages/process/demo.cache.get_invalid_input.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ clever_age_process:
get:
service: '@CleverAge\CacheProcessBundle\Task\GetTask'
options:
adapter: 'memory'
key: '' # Overridden by the input
adapter: 'memory' # key is given by the input
outputs: [ debug ]

debug:
Expand Down
52 changes: 52 additions & 0 deletions config/packages/process/demo.cache.get_on_miss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
clever_age_process:
configurations:
demo.cache.get_on_miss:
description: >
Cache-aside with GetTask on_miss: skip (cleverage/cache-process-bundle#31): a missing key sends the
input to the error outputs, which compute the value and store it. key1 is computed the first time,
then read from the cache
help: >
Ex: bin/console cleverage:process:execute demo.cache.get_on_miss
tasks:
keys:
service: '@CleverAge\ProcessBundle\Task\ConstantIterableOutputTask'
options:
output:
- key: 'key1'
- key: 'key2'
- key: 'key1'
outputs: [ get ]

get:
service: '@CleverAge\CacheProcessBundle\Task\GetTask'
options:
adapter: 'memory' # key is given by the input
on_miss: skip
outputs: [ found ]
error_outputs: [ compute ]

found:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'

compute:
service: '@CleverAge\ProcessBundle\Task\TransformerTask'
options:
transformers:
mapping:
mapping:
key:
code: '[key]'
value:
code: '[key]'
transformers:
sprintf:
format: 'computed %s'
outputs: [ set, computed ]

set:
service: '@CleverAge\CacheProcessBundle\Task\SetTask'
options:
adapter: 'memory' # key and value are given by the input

computed:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
44 changes: 44 additions & 0 deletions config/packages/process/demo.cache.set_expires_after.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
clever_age_process:
configurations:
demo.cache.set_expires_after:
description: >
SetTask expires_after (cleverage/cache-process-bundle#32): the item is stored for 1 second, it is found
right after, and missing after a 2 seconds pause
help: >
Ex: bin/console cleverage:process:execute demo.cache.set_expires_after
tasks:
set:
service: '@CleverAge\CacheProcessBundle\Task\SetTask'
options:
adapter: 'memory'
key: 'short_lived'
value: 'short lived value'
expires_after: 1
outputs: [ get_before, wait ]

get_before:
service: '@CleverAge\CacheProcessBundle\Task\GetTask'
options:
adapter: 'memory'
key: 'short_lived'
on_miss: fail
outputs: [ debug ]

wait:
service: '@CleverAge\ProcessBundle\Task\TransformerTask'
options:
transformers:
constant:
constant: 2
sleep: ~
outputs: [ get_after ]

get_after:
service: '@CleverAge\CacheProcessBundle\Task\GetTask'
options:
adapter: 'memory'
key: 'short_lived'
outputs: [ debug ]

debug:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
4 changes: 1 addition & 3 deletions config/packages/process/demo.cache.set_get.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ clever_age_process:
set:
service: '@CleverAge\CacheProcessBundle\Task\SetTask'
options:
adapter: 'memory'
key: '' # overrided by input'
value: '' # overrided by input
adapter: 'memory' # key and value are given by the input

get:
service: '@CleverAge\CacheProcessBundle\Task\GetTask'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,4 @@ clever_age_process:
set:
service: '@CleverAge\CacheProcessBundle\Task\SetTask'
options:
adapter: 'memory'
key: '' # Overridden by the input
value: ~ # Overridden by the input
adapter: 'memory' # key and value are given by the input
22 changes: 22 additions & 0 deletions config/packages/process/demo.cache.set_invalid_key.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
clever_age_process:
configurations:
demo.cache.set_invalid_key:
description: >
SetTask with a key containing a PSR-6 reserved character (cleverage/cache-process-bundle#30): the key is
rejected by the task, also with --no-debug / in production (Symfony adapters only validate keys with
assert())
help: >
Ex: bin/console cleverage:process:execute demo.cache.set_invalid_key
tasks:
item:
service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask'
options:
output:
key: 'ABC/001'
value: 'value1'
outputs: [ set ]

set:
service: '@CleverAge\CacheProcessBundle\Task\SetTask'
options:
adapter: 'memory' # key and value are given by the input
Loading