PHP code example of liamsorsby / php-hystrix

1. Go to this page and download the library: Download liamsorsby/php-hystrix library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

liamsorsby / php-hystrix example snippets


$cb = $factory->create(StorageFactory::APC, []);

try {
    if(!$cb->isOpen()) {
        // do something
        return;
    }
    // Transactional or complex operation
} catch (Exception $e) {
    $cb->reportFailure('');
    // log error from $e->getMessage()
}