cleverage/cache-process-bundle
CleverAge/CacheProcessBundle integrates Symfony Cache with the CleverAge ProcessBundle, enabling caching within process workflows. Part of the CleverAge/ProcessBundle project, it supports Symfony stable and LTS releases for efficient process execution.
Architecture Fit
The cache-process-bundle remains a strong fit for Laravel/PHP applications that need process execution coupled with caching, built on Symfony Process and Symfony Cache. v2.2 deepens that fit by moving validation and policy into the task layer rather than the DI/config layer:
adapter, key and value are no longer required in the bundle configuration (no placeholders needed); they are resolved once the task input is merged. This makes the Symfony service/DI graph cleaner and supports dynamic, per-invocation cache targets.AbstractCacheTask::getRequiredOptions() extension point formalizes how custom tasks declare mandatory options, which is the right seam for teams writing their own tasks on top of the bundle.GetTask gains an on_miss policy (output_null default, skip to route the input to error outputs, fail), giving explicit, configurable cache-miss semantics instead of implicit behavior.SetTask gains expires_after for per-item TTL, closing a real gap for cache hygiene.AdapterRegistry::addAdapter() accepts an optional $serviceId), and non-array task input now raises an explicit \UnexpectedValueException instead of a \TypeError from array_merge().Integration Feasibility
High, and higher than at v2.0. v2.2 is a minor release: no removals, no renames, no config schema breakage. The changes are additive (two new options, one new abstract method with a default-driven contract) plus behavior fixes. Existing v2.x integrations should upgrade with a composer update and no code changes, unless they:
assert() is enabled.The relaxed configuration requirement is a genuine simplification, but it shifts validation from boot time to runtime, which must be understood before adoption.
Technical Risk
null, overwrite, custom AbstractCacheTask subclasses, Adapter, bundle, DI extension). The obsolete test.old directory was removed, which is internal housekeeping.adapter, key and value are no longer required at configuration level, a missing or wrong value fails at task execution, not at container build. Misconfiguration surfaces in production paths rather than in CI.zend.assertions=-1 (typical production), Symfony adapters do not reject invalid keys. The bundle validates keys itself, but any key constructed outside the task path can still reach an adapter unvalidated. This is now documented rather than silently assumed.\UnexpectedValueException. Both are correct behaviors that can break code which "worked" by accident. Any catch (\TypeError) blocks around task execution must be widened.symfony/process and symfony/cache remains the dominant integration hazard.on_miss: skip routes input to the task's error outputs. That is a pipeline-topology decision, not a config tweak; it must be reviewed wherever downstream tasks assume a value on the success output.Key Questions
catch (\TypeError) blocks or type-tolerant wrappers around GetTask/SetTask that will no longer trigger?output_null, skip, or fail? The v2.2 default remains output_null, so unchanged configs silently keep prior semantics — confirm that is intended.expires_after, and what is the TTL policy per adapter?\UnexpectedValueException on non-array input, and one asserting invalid-key rejection with assertions enabled in CI?on_miss: fail under partial cache outage?Stack Fit
Migration Path
composer update cleverage/cache-process-bundle --with-dependencies to land v2.2.composer.json constraint change needed beyond an existing ^2.0 requirement; pin ^2.2 if you intend to depend on on_miss, expires_after, or getRequiredOptions().adapter / key / value placeholders from task definitions in the bundle configuration; supply them through task input instead.AbstractCacheTask::getRequiredOptions() rather than validating in execute().on_miss per GetTask: keep the output_null default for tolerant pipelines, use skip where downstream tasks must not run on a miss, use fail for hard dependencies.expires_after to SetTask definitions with an explicit TTL per data class.\UnexpectedValueException (and keep \TypeError handling for defense in depth).zend.assertions=1 in CI to exercise adapter key validation, and separately with assertions disabled to confirm the application's own key validation holds.Compatibility
symfony/process and symfony/cache must align with the v2 baseline (8.0+ on the target stack); the adapter layer is where key-validation behavior differs, so confirm the adapter in use.pcntl / posix requirements unchanged.Sequencing
on_miss variants and expires_after against the production-like cache backend.output_null default (behavior-preserving), then opt individual tasks into skip/fail behind feature flags.Maintenance
getRequiredOptions() to stay consistent.Support
on_miss semantics and the assertion-dependent key validation, since both change failure appearance without changing configuration.Scaling
expires_after enables TTL-based eviction, which bounds cache growth and is the main lever for memory pressure on Redis/Memcached clusters.on_miss: fail converts a cache outage into immediate task errors — good for latency, but it removes the implicit load-shedding that output_null provides and can stampede the origin. Test under load before adopting broadly.on_miss: skip short-circuits downstream work on misses, reducing process spawns; monitor error-output volume as a proxy for cache hit rate.Failure Modes
| Scenario | Impact | Mitigation |
|---|---|---|
Missing adapter/key/value after config simplification |
Task fails at runtime, not at container build | Add a smoke test that executes each task once in CI; validate inputs at the call site |
| Invalid cache key with assertions disabled | Key accepted by Symfony adapter, silent misbehavior | Validate keys in application code or an input DTO; run one CI job with zend.assertions=1 |
on_miss: skip misconfigured |
Input silently routed to error outputs; success branch starves | Document per-task policy; alert on error-output rate |
on_miss: fail during cache outage |
Immediate task failures, origin stampede | Combine with circuit breaker/backoff; keep output_null for non-critical tasks |
| Option value rejected by resolver post-upgrade | Previously working config throws | Audit task inputs for loose types before deploying v2.2 |
| Non-array input | \UnexpectedValueException (previously \TypeError) |
Update catch blocks; add contract tests on task inputs |
| Duplicate adapter code | Container/compile-time error naming both service IDs | Resolve the collision surfaced by the improved message |
| PHP/Symfony upgrade failure | Application crashes | Stage the upgrade; isolate with Docker |
Ramp-Up
expires_after, and the "config is optional, input is authoritative" rule for adapter/key/value.getRequiredOptions() for anyone authoring custom tasks, and the assertion-dependent key validation so engineers do not rely on adapter-side rejection in production.How can I help you explore Laravel packages today?