Skip to content
This repository has been archived by the owner on Nov 9, 2018. It is now read-only.

Innmind/HomeostasisBundle

Repository files navigation

Homeostasis Bundle

master develop
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:

// app/AppKernel.php

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

Then you need to specify the an actuator:

innmind_homeostasis:
    actuator: service_id

The actuator service will need to implement the interface Innmind\Homeostasis\Actuator.

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.

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).

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages