Noisy Pillaging Monster

    @bbc/http-transport-circuit-breaker

    1.2.0 • Public • Published

    http-transport-circuit-breaker

    Basic circuit breaker based on Levee.

    Installation

    npm install --save @bbc/http-transport-circuit-breaker
    

    Usage

    const Levee = require('levee');
    const request = require('request');
    
    const options = {
        maxFailures: 5,
        timeout: 60000,
        resetTimeout: 30000
    };
    
    const circuit = Levee.createBreaker(request.get, options);
    circuit.run('http://www.google.com', (err, req, payload) => {
        console.log(err || payload);
    });

    Test

    npm test
    

    To generate a test coverage report:

    npm run coverage
    

    Keywords

    none

    Install

    npm i @bbc/http-transport-circuit-breaker

    DownloadsWeekly Downloads

    178

    Version

    1.2.0

    License

    Apache-2.0

    Unpacked Size

    15.8 kB

    Total Files

    10

    Last publish

    Collaborators

    • remotecharms
    • angie
    • npmbs
    • vaughr03
    • iuketaylor
    • jamiebower185
    • bucklm03
    • benjwheeler
    • onlyonehas
    • drrobharper
    • johnnewman
    • ibl
    • simontanner
    • simongregory
    • magdalena.glanc
    • tonymcbeth