Skip to content

Commit 4f7b018

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: fixes async cache computation example and FQCN
2 parents e5f4db2 + 482ebd5 commit 4f7b018

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cache.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ In the following example, the value is requested from a controller::
895895
public function index(CacheInterface $asyncCache): Response
896896
{
897897
// pass to the cache the service method that refreshes the item
898-
$cachedValue = $cache->get('my_value', [CacheComputation::class, 'compute'])
898+
$cachedValue = $asyncCache->get('my_value', [CacheComputation::class, 'compute'])
899899

900900
// ...
901901
}
@@ -913,13 +913,13 @@ a message bus to compute values in a worker:
913913
cache:
914914
pools:
915915
async.cache:
916-
early_expiration_message_bus: async_bus
916+
early_expiration_message_bus: messenger.default_bus
917917
918918
messenger:
919919
transports:
920920
async_bus: '%env(MESSENGER_TRANSPORT_DSN)%'
921921
routing:
922-
Symfony\Component\Cache\Messenger\Message\EarlyExpirationMessage: async_bus
922+
'Symfony\Component\Cache\Messenger\EarlyExpirationMessage': async_bus
923923
924924
.. code-block:: xml
925925
@@ -935,12 +935,12 @@ a message bus to compute values in a worker:
935935
>
936936
<framework:config>
937937
<framework:cache>
938-
<framework:pool name="async.cache" early-expiration-message-bus="async_bus"/>
938+
<framework:pool name="async.cache" early-expiration-message-bus="messenger.default_bus"/>
939939
</framework:cache>
940940
941941
<framework:messenger>
942942
<framework:transport name="async_bus">%env(MESSENGER_TRANSPORT_DSN)%</framework:transport>
943-
<framework:routing message-class="Symfony\Component\Cache\Messenger\Message\EarlyExpirationMessage">
943+
<framework:routing message-class="Symfony\Component\Cache\Messenger\EarlyExpirationMessage">
944944
<framework:sender service="async_bus"/>
945945
</framework:routing>
946946
</framework:messenger>
@@ -957,7 +957,7 @@ a message bus to compute values in a worker:
957957
return static function (FrameworkConfig $framework): void {
958958
$framework->cache()
959959
->pool('async.cache')
960-
->earlyExpirationMessageBus('async_bus');
960+
->earlyExpirationMessageBus('messenger.default_bus');
961961
962962
$framework->messenger()
963963
->transport('async_bus')

0 commit comments

Comments
 (0)