Ganesha Versions Save

:elephant: A Circuit Breaker pattern implementation for PHP applications.

1.2.2

3 years ago

Fix backward incompatibility in v1.2.1 by ackintosh · Pull Request #81 · ackintosh/ganesha

This release is to ease the backward incompatibility in 1.2.1.

Unfortunately this release does not completely fix the incompatibility. If you are using your custom adapter, please add setContext method like below in order to keep behaviors of your adapter.

If your custom adapter extends a built in adapter like below, it is recommended to use the parent implementation:

class CustomAdapter extends \Ackintosh\Ganesha\Storage\Adapter\Memcached
{
    // Comment out to use the parent implementation
    // public function setContext(Ganesha\Context $context): void
    // {
    // }
}

or if your custom adapter using no built in adapter, please add an empty setContext method to satisfy AdapterInterface requirement.

class CustomAdapter implements \Ackintosh\Ganesha\Storage\AdapterInterface
{
    public function setContext(Ganesha\Context $context): void
    {
         // nop
    }
}

1.0.0

4 years ago

I'm excited to announce v1.0.0 - the first major release of Ganesha. 🎉 🎉

This release comes with breaking changes. Please refer to the following for details.

Drop support for PHP 5 and 7.0

Support for the versions that reached the EOL has been dropped.

PHP: Supported Versions

A new Builder

To make Ganesha more developer-friendly, the way how to pass build parameters has been changed, from an associative array to builder methods.

  • Developers can find what parameters are available easily via IDE's auto-completion functionality
  • Developers can have benefits of the type hinting

Before (<= 0.5.0)

// Rate strategy
$ganesha = Ackintosh\Ganesha\Builder::build([
    'timeWindow' => 30,
    'failureRateThreshold' => 90,
    'minimumRequests' => 10,
    'intervalToHalfOpen' => 5,
    'adapter' => new Ackintosh\Ganesha\Storage\Adapter\Memcached($memcached),
]);

// Count strategy
$ganesha = Ackintosh\Ganesha\Builder::buildwithCountStrategy([
    'failureCountThreshold' => 100,
    'intervalToHalfOpen' => 5,
    'adapter' => new Ackintosh\Ganesha\Storage\Adapter\Memcached($memcached),
]);

After (>= 1.0.0)

// Rate strategy
$ganesha = Ackintosh\Ganesha\Builder::withRateStrategy()
    ->timeWindow(30)
    ->failureRateThreshold(90)
    ->minimumRequests(10)
    ->intervalToHalfOpen(5)
    ->adapter(new Ackintosh\Ganesha\Storage\Adapter\Memcached($memcached))
    ->build();

// Count strategy
$ganesha = Ackintosh\Ganesha\Builder::withCountStrategy()
    ->failureCountThreshold(100)
    ->intervalToHalfOpen(5)
    ->adapter(new Ackintosh\Ganesha\Storage\Adapter\Memcached($memcached))
    ->build();

Thank you for using Ganesha! ✨🐘✨

0.5.0

4 years ago

Customizable storage keys

If you want customize the keys to be used when storing circuit breaker information, set an instance which implements StorageKeysInterface.

class YourStorageKeys implements StorageKeysInterface
{
    public function prefix()
    {
        return 'your_prefix_';
    }
    
    // (ommitted)
}

$ganesha = Ackintosh\Ganesha\Builder::build([
    // The keys which will stored by Ganesha to the storage you specified via `adapter`
    // will be prefixed with `your_prefix_`.
    'storageKeys' => new YourStorageKeys(),
]);

0.4.2

4 years ago

Even though Guzzle is not a core library for Ganesha, it was specified as required dependency. That is useless dependency for developers who wants to use only Ganesha without Guzzle.

From this release, Guzzle is specified "suggest" section in composer.json instead of "require-dev".