PHPackages                             fyennyi/async-cache-bridge-symfony - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. fyennyi/async-cache-bridge-symfony

ActiveLibrary[Caching](/categories/caching)

fyennyi/async-cache-bridge-symfony
==================================

Symfony bridge for Fyennyi AsyncCache.

v1.0.0(3mo ago)00LicenseRef-CSSM-Unlimited-2.0PHPPHP ^8.1CI passing

Since Jan 30Pushed 2mo agoCompare

[ Source](https://github.com/Fyennyi/async-cache-bridge-symfony)[ Packagist](https://packagist.org/packages/fyennyi/async-cache-bridge-symfony)[ Fund](https://opencollective.com/cssm)[ Patreon](https://www.patreon.com/ChernegaSergiy)[ RSS](/packages/fyennyi-async-cache-bridge-symfony/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Async Cache Symfony Bridge
==========================

[](#async-cache-symfony-bridge)

[![Latest Stable Version](https://camo.githubusercontent.com/df3f56f17059eb0580346bfc37c6528bfaa6d798dbb6be328a18088a32d72ff2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6679656e6e79692f6173796e632d63616368652d6272696467652d73796d666f6e792e7376673f6c6162656c3d5061636b6167697374266c6f676f3d7061636b6167697374)](https://packagist.org/packages/fyennyi/async-cache-bridge-symfony)[![Total Downloads](https://camo.githubusercontent.com/a04e166e4aee683f8c9f3c53c7bda33f6e133827d5e03bb47d1212cffbf855b6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6679656e6e79692f6173796e632d63616368652d6272696467652d73796d666f6e792e7376673f6c6162656c3d446f776e6c6f616473266c6f676f3d7061636b6167697374)](https://packagist.org/packages/fyennyi/async-cache-bridge-symfony)[![License](https://camo.githubusercontent.com/5e57366e6439198f9d4db9b24933ce21b180e65f351b238338cbe14f8112d99f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6679656e6e79692f6173796e632d63616368652d6272696467652d73796d666f6e792e7376673f6c6162656c3d4c6963656e6365266c6f676f3d6f70656e2d736f757263652d696e6974696174697665)](https://packagist.org/packages/fyennyi/async-cache-bridge-symfony)[![Tests](https://camo.githubusercontent.com/52b5b2ed9df0a18a26d1a186b1aeea3cc07b3f834a1d7167546cd001d7c2da4d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4679656e6e79692f6173796e632d63616368652d6272696467652d73796d666f6e792f706870756e69742e796d6c3f6c6162656c3d5465737473266c6f676f3d676974687562)](https://github.com/Fyennyi/async-cache-bridge-symfony/actions/workflows/phpunit.yml)[![Test Coverage](https://camo.githubusercontent.com/1bee4621dd662edf0f297150450cf3f05598bec21b5b44599f9f7ca581bd45e4/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f4679656e6e79692f6173796e632d63616368652d6272696467652d73796d666f6e793f6c6162656c3d54657374253230436f766572616765266c6f676f3d636f6465636f76)](https://app.codecov.io/gh/Fyennyi/async-cache-bridge-symfony)[![Static Analysis](https://camo.githubusercontent.com/172003e2a889016a021a16cdbdb069f60ad66c3e22b46adf10b168bad7c0243e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4679656e6e79692f6173796e632d63616368652d6272696467652d73796d666f6e792f7068707374616e2e796d6c3f6c6162656c3d5048505374616e266c6f676f3d676974687562)](https://github.com/Fyennyi/async-cache-bridge-symfony/actions/workflows/phpstan.yml)

This is a **Symfony Bridge** for the [Async Cache PHP](https://github.com/Fyennyi/async-cache-php) library. It integrates the asynchronous caching manager directly into your Symfony application, automatically wiring it with the default Symfony Cache, Lock, and Logger components.

Features
--------

[](#features)

- **Automatic Service Registration**: Registers `AsyncCacheManager` as a service in the container.
- **Seamless Integration**: Automatically injects:
    - `cache.app` (Your default Symfony cache pool).
    - `lock.factory` (Symfony Lock component for atomic operations).
    - `logger` (Monolog integration).
    - `event_dispatcher`.
- **Configuration Friendly**: Allows defining global strategies via `yaml` configuration.

Installation
------------

[](#installation)

Run the following command in your terminal:

```
composer require fyennyi/async-cache-bridge-symfony
```

If you are not using Symfony Flex, you may need to register the bundle manually in `config/bundles.php`:

```
// config/bundles.php
return [
    // ...
    Fyennyi\AsyncCache\Bridge\Symfony\AsyncCacheBundle::class => ['all' => true],
];
```

Configuration
-------------

[](#configuration)

You can configure the default behavior of the cache manager in `config/packages/async_cache.yaml`.

```
# config/packages/async_cache.yaml
async_cache:
    # Set the default strategy for cache misses (strict, background, etc.)
    # Default is 'strict'
    default_strategy: strict
```

Usage
-----

[](#usage)

### Injecting the Manager

[](#injecting-the-manager)

The bridge registers the `Fyennyi\AsyncCache\AsyncCacheManager` class in the service container. You can use dependency injection to access it in your Controllers or Services.

```
namespace App\Service;

use Fyennyi\AsyncCache\AsyncCacheManager;
use Fyennyi\AsyncCache\CacheOptions;

class WeatherService
{
    public function __construct(
        private AsyncCacheManager $cache
    ) {}

    public function getForecast(string $city): \React\Promise\PromiseInterface
    {
        return $this->cache->wrap(
            'weather_' . $city,
            fn() => $this->fetchFromApi($city),
            new CacheOptions(ttl: 300)
        );
    }

    private function fetchFromApi(string $city) { /* ... */ }
}
```

### Requirements

[](#requirements)

Since this bridge automatically wires Symfony components, ensure your environment has the necessary services configured:

- **Cache**: A configured `cache.app` pool (standard in Symfony).
- **Lock**: The `symfony/lock` component (recommended for atomic operations).

```
composer require symfony/lock
```

Contributing
------------

[](#contributing)

Contributions are welcome and appreciated! Here's how you can contribute:

1. Fork the project
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

Please make sure to update tests as appropriate and adhere to the existing coding style.

License
-------

[](#license)

This library is licensed under the CSSM Unlimited License v2.0 (CSSM-ULv2). See the [LICENSE](LICENSE) file for details.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance84

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

103d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e2471bdadcf4a5ea969fe763a72d03fb46525b59a7e4cedc3ed4d855029e7785?d=identicon)[ChernegaSergiy](/maintainers/ChernegaSergiy)

---

Top Contributors

[![ChernegaSergiy](https://avatars.githubusercontent.com/u/60980650?v=4)](https://github.com/ChernegaSergiy "ChernegaSergiy (45 commits)")

---

Tags

asyncbridgecachingclockdependency-injectionphppsr-16symfony

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/fyennyi-async-cache-bridge-symfony/health.svg)

```
[![Health](https://phpackages.com/badges/fyennyi-async-cache-bridge-symfony/health.svg)](https://phpackages.com/packages/fyennyi-async-cache-bridge-symfony)
```

###  Alternatives

[symfony-bundles/redis-bundle

Symfony Redis Bundle

271.1M5](/packages/symfony-bundles-redis-bundle)[resquebundle/resque

A Symfony 4 bundle to manage Resque job queues

51137.1k1](/packages/resquebundle-resque)[rikudou/psr6-dynamo-db-bundle

PSR-6 and PSR-16 cache implementation using AWS DynamoDB for Symfony

2077.8k](/packages/rikudou-psr6-dynamo-db-bundle)[mmoreram/rsqueue-bundle

Redis Symfony2 Queue Bundle, a simple and soft redis based message queue for symfony2

5360.7k1](/packages/mmoreram-rsqueue-bundle)[ack/notification-bundle

Symfony real time notification system

259.3k](/packages/ack-notification-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
