2017 © Pedro Peláez
 

library homeostasis-bundle

App health regulator bundle

image

innmind/homeostasis-bundle

App health regulator bundle

  • Saturday, October 7, 2017
  • by Baptouuuu
  • Repository
  • 1 Watchers
  • 0 Stars
  • 119 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 14 % Grown

The README.md

Homeostasis Bundle

master | develop | , (*1)

Scrutinizer Code Quality | Scrutinizer Code Quality
Code Coverage | Code Coverage
Build Status | Build Status

Installation

composer require innmind/homeostasis-bundle

Enable the bundle by adding the following line in your app/AppKernel.php of your project:, (*2)

// app/AppKernel.php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Innmind\HomeostasisBundle\InnmindHomeostasisBundle,
        );
        // ...
    }
    // ...
}

Then you need to specify the an actuator:, (*3)

innmind_homeostasis:
    actuator: service_id

The actuator service will need to implement the interface Innmind\Homeostasis\Actuator., (*4)

By default it uses the cpu and symfony logs as factors, but you can your own via the factors config key. To add a factor you need to create a service tagged with innmind.homeostasis.factor and with an alias attribute, this alias will need to be a key in the factors config. If you define a factory on your service then the data under your alias in the config will be injected in the factory service., (*5)

Usage

To trigger the whole mechanism you just have to call the following code somewhere in your app (for exemple on console.terminate when an amqp consumer finished his job)., (*6)

$container->get('innmind.homeostasis.regulator')();

The Versions