New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

chainbuilder-retry

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chainbuilder-retry

Retry mixin for chainbuilder.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

chainbuilder-retry Build Status

A retry mixin for chainbuilder.

Installation npm install chainbuilder chainbuilder-retry --save

Usage

var chainBuilder = require('chainbuilder');

var myChain = chainBuilder({
  methods: {/* ... your methods ... */},
  mixins: [
    /* ... other mixins ... */
    require('chainbuilder-retry')({ attempts: 5, maxTimeout: 100 })
  ]
});

Example
Will retry the myMethodTwo().myMethodThree() chain up to two times until no error is received. myMethodTwo() will have access to the result of myMethodOne() (via previousResult()), and myMethodFour() will have access to the result of myMethodThree().

myChain()
  .myMethodOne()
  .$beginRetry({ attempts: 2 }}
    .myMethodTwo()
    .myMethodThree()
  .$endRetry()
  .myMethodFour()

Methods

require('chainbuilder-retry')(options)

Init the mixin with default options.

@param {Object} options (optional) default retry options.

$beginRetry(options)

Begin a retry block.

@param {Object} options (optional) retry options for this block.

$endRetry()

End a retry block.

Keywords

chainbuilder

FAQs

Package last updated on 29 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts