Skip to content

Commit 2ab5def

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: fixes async cache computation example and FQCN
2 parents 0b1549c + a09f7b6 commit 2ab5def

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
@@ -920,7 +920,7 @@ In the following example, the value is requested from a controller::
920920
public function index(CacheInterface $asyncCache): Response
921921
{
922922
// pass to the cache the service method that refreshes the item
923-
$cachedValue = $cache->get('my_value', [CacheComputation::class, 'compute'])
923+
$cachedValue = $asyncCache->get('my_value', [CacheComputation::class, 'compute'])
924924

925925
// ...
926926
}
@@ -938,13 +938,13 @@ a message bus to compute values in a worker:
938938
cache:
939939
pools:
940940
async.cache:
941-
early_expiration_message_bus: async_bus
941+
early_expiration_message_bus: messenger.default_bus
942942
943943
messenger:
944944
transports:
945945
async_bus: '%env(MESSENGER_TRANSPORT_DSN)%'
946946
routing:
947-
Symfony\Component\Cache\Messenger\Message\EarlyExpirationMessage: async_bus
947+
'Symfony\Component\Cache\Messenger\EarlyExpirationMessage': async_bus
948948
949949
.. code-block:: xml
950950
@@ -960,12 +960,12 @@ a message bus to compute values in a worker:
960960
>
961961
<framework:config>
962962
<framework:cache>
963-
<framework:pool name="async.cache" early-expiration-message-bus="async_bus"/>
963+
<framework:pool name="async.cache" early-expiration-message-bus="messenger.default_bus"/>
964964
</framework:cache>
965965
966966
<framework:messenger>
967967
<framework:transport name="async_bus">%env(MESSENGER_TRANSPORT_DSN)%</framework:transport>
968-
<framework:routing message-class="Symfony\Component\Cache\Messenger\Message\EarlyExpirationMessage">
968+
<framework:routing message-class="Symfony\Component\Cache\Messenger\EarlyExpirationMessage">
969969
<framework:sender service="async_bus"/>
970970
</framework:routing>
971971
</framework:messenger>
@@ -982,7 +982,7 @@ a message bus to compute values in a worker:
982982
return static function (FrameworkConfig $framework): void {
983983
$framework->cache()
984984
->pool('async.cache')
985-
->earlyExpirationMessageBus('async_bus');
985+
->earlyExpirationMessageBus('messenger.default_bus');
986986
987987
$framework->messenger()
988988
->transport('async_bus')

0 commit comments

Comments
 (0)