Skip to content

Async cache wrong callback example #20874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
torchello opened this issue Apr 10, 2025 · 2 comments
Open

Async cache wrong callback example #20874

torchello opened this issue Apr 10, 2025 · 2 comments

Comments

@torchello
Copy link

Hey! Seems like an example of a callback in async cache section is incorrect:

$cachedValue = $asyncCache->get('my_value', [CacheComputation::class, 'compute'])

It's not a valid callback as the compute method is not static in the example:

class CacheComputation
{
    public function compute(ItemInterface $item): string
    {
        ...
    }
}

Am I missing something or we should adjust the docs?

@torchello
Copy link
Author

Actually, some info from this page could be added to the docs. Wdyt?
https://symfony.com/blog/new-in-symfony-5-2-async-cache-recomputing

@torchello
Copy link
Author

Also, seems like

early_expiration_message_bus: messenger.default_bus

should be

early_expiration_message_bus: messenger.bus.default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant