diff --git a/cache.rst b/cache.rst index 43d417c1738..5dd560a94cc 100644 --- a/cache.rst +++ b/cache.rst @@ -907,7 +907,7 @@ In the following example, the value is requested from a controller:: public function index(CacheInterface $asyncCache): Response { // pass to the cache the service method that refreshes the item - $cachedValue = $cache->get('my_value', [CacheComputation::class, 'compute']) + $cachedValue = $asyncCache->get('my_value', [CacheComputation::class, 'compute']) // ... } @@ -925,13 +925,13 @@ a message bus to compute values in a worker: cache: pools: async.cache: - early_expiration_message_bus: async_bus + early_expiration_message_bus: messenger.default_bus messenger: transports: async_bus: '%env(MESSENGER_TRANSPORT_DSN)%' routing: - Symfony\Component\Cache\Messenger\Message\EarlyExpirationMessage: async_bus + 'Symfony\Component\Cache\Messenger\EarlyExpirationMessage': async_bus .. code-block:: xml @@ -947,12 +947,12 @@ a message bus to compute values in a worker: > - + %env(MESSENGER_TRANSPORT_DSN)% - + @@ -969,7 +969,7 @@ a message bus to compute values in a worker: return static function (FrameworkConfig $framework): void { $framework->cache() ->pool('async.cache') - ->earlyExpirationMessageBus('async_bus'); + ->earlyExpirationMessageBus('messenger.default_bus'); $framework->messenger() ->transport('async_bus')